T-SQL Tutorial

T-SQL ISNULL System Function


Substitute NULL with the specified substituted value.

ISNULL Syntax:

ISNULL(expression , substitute_value)

ISNULL Example:

SELECT ISNULL('abc',28) as col_1,
ISNULL('01/28/2014',7) as col_2,
ISNULL(null,9) as col_3,
ISNULL(null,null) as col_4,
ISNULL('-',-1) as col_5;

col_1col_2col_3col_4col_5
abc01/28/20149NULL-

See also: T-SQL Functions -> COALESCE | HOST_ID | HOST_NAME | ISNUMERIC | NULLIF