Click or drag to resize

SA0177 : To improve code readability, put only one statement per line

The topic describes the SA0177 analysis rule.

Message

To improve code readability, put only one statement per line

Description

The rule checks for more than one statement placed on one and the same line.

The code should be reformatted to have a single statement per line.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
 1CREATE TABLE Test.Greeting
 2(
 3GreetingId INT IDENTITY (1,1) PRIMARY KEY,
 4Message nvarchar(255) NOT NULL,
 5) 
 6
 7INSERT INTO Test.Greeting (Message) SELECT 'Hello!' UNION ALL SELECT 'Hi!' UNION ALL SELECT 'Hello, world!'
 8
 9INSERT INTO Test.Greeting (Message) 
10VALUES ('How do yo do?'),
11        ('Good morning!'),
12        ('Good night!')  SELECT * FROM Test.Greeting g 
13WHERE 
14g.Message like 'Hello%'
15
16DELETE  Test.Greeting WHERE GreetingId = 3;  DROP TABLE Test.Greeting

Analysis Results

 MessageLineColumn
1SA0177 : To improve code readability, put only one statement per line.160
2SA0177 : To improve code readability, put only one statement per line.1645
See Also

Other Resources