IS [NOT] NULL (TSQL Operator)

Checks if a specified expression is NULL.

Syntax

expression IS [NOT] NULL

Arguments

expression
is an expression of any type.

Return Types

Returns a bool value.

Remarks

Returns True if expression is NULL. Else, returns False.

IS NOT NULL returns the negated result of IS NULL.

Examples

DECLARE @a INT; -- value of @a is NULL

PRINT @a IS NULL;
PRINT @a IS NOT NULL;

SET @a = 123;
PRINT @a IS NULL;

The result is:

true
false
false
RSQL, a simple alternative to Microsoft SQL Server