consider this very short T-SQL code that does a test on a nullable column using a case
declare @t table(data varchar(10) null)
insert into @t values('something')
insert into @t values(null)
select data,
case data when null
then 'missing'
else 'not missing'
end as test
from @t
the output that I get is:
data test
--------- -----------
something not missing
NULL not missing
However what I was expecting was
data test
--------- -----------
something not missing
NULL missing
What am I missing concerning the test on this nullable value
You want to put something like this: