SA0177 : To improve code readability, put only one statement per line |
The topic describes the SA0177 analysis rule.
To improve code readability, put only one statement per line
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.
Place the start of each statement on own line.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
Design Rules, Code Smells
There is no additional info for this rule.
SQL
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 |
Message | Line | Column | |
---|---|---|---|
1 | SA0177 : To improve code readability, put only one statement per line. | 16 | 0 |
2 | SA0177 : To improve code readability, put only one statement per line. | 16 | 45 |