ercan ercan - 25 days ago 26
SQL Question

Inverse of COALESCE

is there a function in SQL Server 2005 that returns NULL [or a boolean value] if any of the arguments (of any type) is NULL, which would save me from writing

IF a IS NULL OR b IS NULL OR c IS NULL ...
.

Answer

Here is a moderately unpleasant way of doing it:

set ansi_nulls off
if (null in (a, b, c, d, e) print 'got a null'
set ansi_nulls on
Comments