SQL Flow Field Guide

NULL & UNKNOWN

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

three-valued logic rules

What changes

Input
none
Output or change
none

Syntax at a glance

NULL

Work example

A predicate or expression can receive NULL and needs an explicit UNKNOWN rule.

Evaluate the condition with NULL, then test the result in WHERE and CASE separately.

Check your work NULL & UNKNOWN. The code handles UNKNOWN deliberately and never treats NULL as equal to an ordinary value.

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