SA0125 : Avoid use of the SELECT INTO syntax

The topic describes the SA0125 analysis rule.

Message

Avoid use of the SELECT INTO syntax

Description

The rule checks for SELECT INTO statement being used.

How to fix

Consider replacing the SELECT INTO statement with explicit table creation and then use the INSERT INTO statement.

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.

Effort To Fix
20 minutes per issue.
Categories

Design Rules, Code Smells

Additional Information
Example Test SQL
SQL
1SELECT * INTO Table2 FROM Table1
2
3SELECT * INTO Table2 /*IGNORE:SA0125*/ FROM Table1 
4
5SELECT * INTO /*IGNORE:SA0125*/ Table2  FROM Table1

Analysis Results
  Message Line Column
1 SA0125 : Avoid use of the SELECT INTO syntax. 1 9
See Also

Other Resources