• Kevin Gill (8/14/2009)


    The main impact of this that I've come across is that if you have two variables and both are null, the only complete equality check with ANSI NULLS on is :

    IF @a = @b-2 OR (@a IS NULL AND @b-2 IS NULL)

    or shortened using my favourite TSQL function, to

    IF COALESCE(@a,-1) = COALESCE(@b,-1)

    -- Kev

    Although the version with coalesce does work when both @a and @b-2 are null, it will also deliver TRUE is one of them is null and the other is -1; so it isn't something you should use.

    Tom