Click or drag to resize

EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss

The topic describes the EX0021 analysis rule.

Message

Check DROP TABLE statements in order to avoid unintentional data loss

Description

The rule examines T-SQL code and reports all DROP TABLE statements, which are not ignored using a rule suppression comment.

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

Explicit Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
1DROP TABLE Test.Greeting
2
3DROP TABLE Test.Greeting -- IGNORE:EX0021
4
5DROP TABLE #temp, aaa

Analysis Results

 MessageLineColumn
1EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss.10
2EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss.50
See Also

Other Resources