SQL Flow Field Guide

ISNULL

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

NULL replacement

What changes

Input
check expression and replacement
Output or change
replacement when the first is NULL (typed as the first argument)
Return type
Returns the same type as check_expression. If a literal NULL is provided as check_expression, ISNULL returns the data type of the replacement_value. If a literal NULL is provided as check_expression a

Syntax at a glance

ISNULL ( check_expression , replacement_value )

Work example

Replace one nullable expression with a fallback of the intended output type.

Cast the first argument when the fallback must determine a wider result type.

Check your work ISNULL returns the type of its first argument, so a longer replacement can be truncated.

Practice SQL

Open in SQL Flow
SELECT ISNULL(CAST(NULL AS varchar(12)), 'not supplied') AS label;

Open Microsoft Learn for full syntax, permissions, and details for your version.