Tuesday, November 20, 2012

ISNULL in MSSQL

This suggests this:

ISNULL ( check_expression , replacement_value )

 
 

...is how to handle a value being null. You could use it to replace something like this:

SELECT Foo, Bar, Baz FROM Qux

 
 

...with something like this:

SELECT Foo, ISNULL ( BAR , 42 ), Baz FROM Qux

No comments:

Post a Comment