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.

How to fix

Check each DROP TABLE statements before executing the script to avoid unintentional data loss.

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

Explicit Rules

Additional Information

There is no additional info for this rule.

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

Analysis Results
  Message Line Column
1 EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss. 1 0
2 EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss. 5 0
See Also

Other Resources