Hi,
here is my Query and need help in errormesssage column, when there is multiple column with Null then it should be ' CustomerName is Null; Customer City is Null' or CustomerCity is Null; CustomerCountry is Null' based on all the columns that is Null. this is just sample code in real table it will be checked for around 10-15 columns.
select CustomerID,
CASE when CustomerName IS Null OR
(CustomerCity)IS Null OR
(CustomerCountry) IS Null
then 'Yes' ELSE 'NO'
END as recordvalid,
CASE when CustomerName IS Null Then ' CustomerName IS Null;'
when CustomerCity IS Null Then ' CustomerCity IS Null;'
when CustomerCountry IS Null Then ' CustomerCountry IS Null;'
END errormessage
into #temp
from Customer
thanks