SQL Flow Field Guide

SET CONCAT_NULL_YIELDS_NULL

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

'a' + NULL yields NULL when ON; changes string concatenation results

What changes

Input
none
Output or change
session state

Syntax at a glance

SET CONCAT_NULL_YIELDS_NULL { ON | OFF }

Work example

A session or module needs the behavior controlled by SET CONCAT_NULL_YIELDS_NULL for a stated reason.

Check when SQL Server reads the option, its scope, and how a reused connection is reset. Change one setting at a time in a test session.

Check your work SET CONCAT_NULL_YIELDS_NULL. The statement is affected by SET CONCAT_NULL_YIELDS_NULL as intended and the setting does not leak into the next session task.

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