Click or drag to resize

SA0261 : The number of characters per line should not exceed the configured value

The topic describes the SA0261 analysis rule.

Message

The number of characters per line should not exceed the configured value

Description

The rule checks SQL code and reports lines, which have more characters than the maximum number of line characters specified by the MaximumLineLength rule parameter.

Scope

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

Parameters
NameDescriptionDefault Value
MaximumLineLength

Maximum number of characters per line.

120

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
SQL
 1CREATE TABLE SA0261.Greeting 
 2( 
 3    GreetingId INT IDENTITY (1,1) PRIMARY KEY, Message nvarchar(255) NOT NULL, 
 4)
 5
 6INSERT INTO SA0261.Greeting (Message) VALUES ('How do yo do?'), ('Good morning!'), ('Good day!'), ('Good evening!'), ('Good night!')
 7
 8-- this line is not so long comment with more than 100 characters per line.
 9-- this line is a very long and has more than 100 characters, which should trigger a rule violation when the MaximumLineLength parameter has value > 100.
10
11DELETE  SA0261.Greeting WHERE GreetingId = 3

Analysis Results

 MessageLineColumn
1The number of characters per line should not exceed the configured value.60
2The number of characters per line should not exceed the configured value.90
See Also

Other Resources