Modify rule S3358: Add examples for T-SQL (#1501)
This commit is contained in:
parent
dc26f15566
commit
0979a5000c
9
rules/S3358/tsql/compliant.adoc
Normal file
9
rules/S3358/tsql/compliant.adoc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
== Compliant Solution
|
||||||
|
|
||||||
|
[source,sql]
|
||||||
|
----
|
||||||
|
IF @status = 'RUNNING'
|
||||||
|
SELECT 'Running';
|
||||||
|
ELSE
|
||||||
|
SELECT IIF(@hasError, 'Failed', 'Succeeded');
|
||||||
|
----
|
6
rules/S3358/tsql/noncompliant.adoc
Normal file
6
rules/S3358/tsql/noncompliant.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
== Noncompliant Code Example
|
||||||
|
|
||||||
|
[source,sql]
|
||||||
|
----
|
||||||
|
SELECT IIF(@status = 'RUNNING', 'Running', IIF(@hasError, 'Failed', 'Succeeded')) -- Noncompliant
|
||||||
|
----
|
@ -1,4 +1,8 @@
|
|||||||
include::../rule.adoc[]
|
include::../description.adoc[]
|
||||||
|
|
||||||
|
include::noncompliant.adoc[]
|
||||||
|
|
||||||
|
include::compliant.adoc[]
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
ifdef::env-github,rspecator-view[]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user