DELETE Statement (SQL Server) – Simple and Advanced examples


To totally unlock this section you need to Log-in


Login

The SQL DELETE statement allows you to delete a single record or multiple records from a table.

The syntax for the SQL DELETE statement is:

DELETE FROM table

WHERE predicates;

SQL DELETE Statement - One condition example

Let's take a look at a simple example, where we just have one condition in our SQL DELETE statement:

DELETE FROM suppliers

WHERE supplier_name = 'IBM';

This SQL DELETE statement would delete all records from the suppliers table where the supplier_name is IBM.

[tweet]

You may wish to check for the number of rows that will be deleted. You can determine the number of rows that will be deleted by running the following SQL SELECT statement before performing the delete.


To totally unlock this section you need to Log-in


Login

1 thought on “DELETE Statement (SQL Server) – Simple and Advanced examples”

Comments are closed.