DF035: The DELETE statement is used without the limiting clauses.

The topic describes the DF035 T-SQL code analysis rule.

Category

BEST PRACTICE

Message

The DELETE statement is used without the limiting clauses.

Description

The DELETE statement without the row limiting conditions (WHERE or JOIN clauses) may lead to unexpected data loss.

Additional information

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.

Noncompliant code example

DELETE FROM dbo.Employee;

Compliant solution

DELETE FROM dbo.Employee WHERE EmployeeId = 12;

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?