There are a few ways to handle null values in sql:
ISNULL(field,alt)
select ISNULL(a,'is null')
from (select null as a
union select 'not null')
COALESCE(field,alt1[, alt2[, alt3[, etc]]])
Works the same as ISNULL but the alts can be any length or even a table column. First non-null is used.
CASE WHEN
Not really ideal for just a plain null value as you can select several cases:
SELECT CASE
WHEN a is null THEN 'is null'
WHEN a = 'not null' THEN 'something else'
ELSE 'optional default'
END
from (select null as a
union select 'not null')
And then there is the ever reliable IF. Unlike the last three which can only be used within a query, IF can only be used outside of a query:
IF (SELECT Count(1) from (select null as a union select 'not null') WHERE a is null) > 0
BEGIN
raiserror('there''s a null',16,1)
ELSE
END
I hope that sheds some light on the issue :)
Andy