NULLIF Function
This SQL Server tutorial explains how to use the NULLIF
function in SQL Server (Transact-SQL) with syntax and examples.
Description
In SQL Server (Transact-SQL), the NULLIF function compares
expression1 and expression2. If expression1 and expression2 are equal, the
NULLIF function returns NULL. Otherwise, it returns the first expression which
is expression1.
Syntax
The syntax for the NULLIF function in SQL Server
(Transact-SQL) is:
NULLIF( expression1, expression2 )
Parameters or Arguments
expression1, expression2
The expressions that will be compared. Values must be of the
same datatype.