rspec/rules/S1192/tsql/rule.adoc

40 lines
532 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== Noncompliant Code Example
With the default threshold of 3:
2020-06-30 12:47:33 +02:00
----
IF @x='Yes'
SELECT ...
FROM ...
WHERE field='Yes'
...
...
IF @x='Yes'
...
----
== Compliant Solution
----
DECLARE @Yes VARCHAR(3) = 'Yes'
IF @x=@Yes
SELECT ...
FROM ...
WHERE field=@Yes
...
...
IF @x=@Yes
...
----
include::../exceptions.adoc[]
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]