Changing the configuration of database options ANSI_NULLS
, ANSI_PADDING
and CONCAT_NULL_YIELDS_NULL
is
deprecated. The future versions of SQL Server will only support the ON
value, and the SET
statement for those options to
OFF
will eventually generate an error.
Noncompliant code example
SET ANSI_NULLS OFF -- Noncompliant
SELECT column1 FROM table1 WHERE id = NULL
SET ANSI_PADDING OFF -- Noncompliant
SET CONCAT_NULL_YIELDS_NULL ON -- Noncompliant
SET ANSI_PADDING ON -- "ON" is ignored
Compliant solution
SELECT column1 FROM table1 WHERE id IS NULL