rspec/rules/S4154/tsql/rule.adoc

39 lines
913 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
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
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
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
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
SELECT column1 FROM table1 WHERE id IS NULL
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this use of "[ANSI_NULLS|ANSI_PADDING|CONCAT_NULL_YIELDS_NULL]".
endif::env-github,rspecator-view[]