rspec/rules/S1192/tsql/rule.adoc

56 lines
748 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
With the default threshold of 3:
[source,sql]
----
IF @x='Yes'
SELECT ...
FROM ...
WHERE field='Yes'
...
...
IF @x='Yes'
...
----
=== Compliant solution
[source,sql]
----
DECLARE @Yes VARCHAR(3) = 'Yes'
IF @x=@Yes
SELECT ...
FROM ...
WHERE field=@Yes
...
...
IF @x=@Yes
...
----
include::../exceptions.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]