EX0021 : Check DROP TABLE statements in order to avoid unintentional data loss |
![]() |
The topic describes the EX0021 analysis rule.

Check DROP TABLE statements in order to avoid unintentional data loss

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

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

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

Rule has no parameters.

The rule does not need Analysis Context or SQL Connection.


Explicit Rules

There is no additional info for this rule.

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

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 |
