Click or drag to resize

SA0232 : The GO batch terminator command found inside comment

The topic describes the SA0232 analysis rule.

Message

The GO batch terminator command found inside comment

Description

This rule checks comments and reports when a valid GO command text is found inside a commented block.

A valid GO command must be at the beginning of the commented block or on new line, it can be followed either by whitespace or single line comment, and must be followed by newline or the end the comment block.

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
SQL
 1/* select * from go
 2where go > 0
 3or
 4go in ( select 1,2,3) */
 5-- Single line comments starting with GO command:
 6-- GO            -- A singleline comment following the batch terminator is allowed. 
 7-- GO            /* Multiline comment is not allowed after the GO command. */
 8/* go*/
 9
10
11
12/* 
13   GO */
14
15/*    GO */
16
17
18/*  
19  GO  */
20
21/*  
22  GO  */
23
24
25
26/* This comment has the 
27go keyword inside, but does not look as a batch terminator.*/
28

Analysis Results

 MessageLineColumn
1SA0232 : The GO batch terminator command found inside comment.60
2SA0232 : The GO batch terminator command found inside comment.80
3SA0232 : The GO batch terminator command found inside comment.120
4SA0232 : The GO batch terminator command found inside comment.150
5SA0232 : The GO batch terminator command found inside comment.180
6SA0232 : The GO batch terminator command found inside comment.210
See Also

Other Resources