Archive

SQL Server Equivalent of Oracle NVL

Oracle's NVL function takes two arguments:

NVL( a1, a2 )

where a1 and a2 are expressions. The NVL function returns a2 if a1 is NULL. If a1 is not NULL then a1 is returned.

The equivalent of this function in SQL Server is the ISNULL function. Similar to the NVL function, the ISNULL function takes two arguments:

ISNULL ( a1, a2 )

where a1 is the expression to be checked for NULL and a2 is the expression to be returned if a1 is NULL. If a1 is not null then a1 is returned.