Create table #temp ( EmpID int, EmpName nvarchar(50) ) ----------------------------------------- Insert into #temp Values(1,'Ram') Insert into #temp Values(2,'') Insert into #temp Values(3,Null) Insert into #temp Values(4,'Shyam') Insert into #temp Values(5,'') Insert into #temp Values(5,Null) ----------------------------------------- Select *, EmpName1=(CASE EmpName WHEN NULL THEN 'I am Null' WHEN '' THEN 'I am Blank' ELSE EmpName END) from #temp -----------------------------------------
Select *, EmpName1= CASE WHEN EmpName IS NULL THEN 'I am NULL' WHEN EmpName='' THEN 'I am Blank' ELSE EmpName END from #temp
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)