Return the specified value if the expression evaluates to NULL; otherwise, return the expression itself.
SELECT ISNULL(NULL, ‘W3Schools.com’); |
The ISNULL() function substitutes a specified value if the expression is NULL; otherwise, it returns the expression itself.
ISNULL(expression, value) |
Parameter |
Description |
expression |
Mandatory. The expression that is checked to determine if it is NULL. |
value |
Mandatory. The value that is returned if the expression evaluates to NULL. |
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |
Return the specified value if the expression is NULL; otherwise, return the expression itself.
SELECT ISNULL(‘Hello’, ‘W3Schools.com’); |
Return the specified value if the expression is NULL; otherwise, return the expression itself.
SELECT ISNULL(NULL, 500); |