rspec/rules/S1192/tsql/rule.adoc

33 lines
372 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[]