The topic describes the DF035 T-SQL code analysis rule.
BEST PRACTICE
The DELETE statement is used without the limiting clauses.
The DELETE statement without the row limiting conditions (WHERE or JOIN clauses) may lead to unexpected data loss.
Without these conditions, the DELETE statement removes all rows from the specified table, which can result in the deletion of important data. It’s important to include appropriate conditions in the DELETE statement to ensure that only the intended rows are deleted. This helps prevent accidental data loss and maintains data integrity within the database.
DELETE FROM dbo.Employee;
DELETE FROM dbo.Employee WHERE EmployeeId = 12;