for_xml_null_treatment option [database]

Controls the treatment of NULL values in queries that use the FOR XML clause.

Allowed values

Empty, Omit

Default

Omit

Remarks

If you execute a query that includes the FOR XML clause, the for_xml_null_treatment option determines how NULL values are treated. By default, elements and attributes that contain NULL values are omitted from the result. Setting this option to Empty generates empty elements or attributes if the value is NULL.

See also