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_1 | col_2 | col_3 | col_4 | col_5 |
---|---|---|---|---|
abc | 01/28/2014 | 9 | NULL | - |
See also: T-SQL Functions -> COALESCE | HOST_ID | HOST_NAME | ISNUMERIC | NULLIF