rspec/rules/S1139/description.adoc

8 lines
478 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
Executing a ``++DELETE++`` statement without a ``++WHERE++`` clause will delete all rows in a table.
2020-06-30 12:47:33 +02:00
2021-02-02 15:02:10 +01:00
2021-01-27 13:42:22 +01: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
2021-02-02 15:02:10 +01:00
2021-01-27 13:42:22 +01:00
If removing all content from the table is not what is intended, a ``++WHERE++`` clause should be added.