rspec/rules/S1139/description.adoc

6 lines
456 B
Plaintext
Raw Normal View History

Executing a `+DELETE+` statement without a `+WHERE+` clause will delete all rows in a table.
2020-06-30 12:47:33 +02:00
If that is truly what is intended, the `+TRUNCATE+` statement should be used because it is faster and uses fewer system and transaction log resources. Moreover when using the `+TRUNCATE+` statement, there is no ambiguity about the purpose of the SQL statement.
2020-06-30 12:47:33 +02:00
If removing all content from the table is not what is intended, a `+WHERE+` clause should be added.