DELETE Statement in SQL SERVER 2008

The SQL DELETE Statement

1. DELETE is a DML Command.
2. DELETE statement is executed using a row lock, each row in the table is locked for deletion.


3. We can specify filters with where clause
4. It deletes specified data if where condition exists.
5. Delete activates a trigger because the operation are logged individually.
6. Slower than truncate because it keeps logs.
7. Rollback is possible.


SQL DELETE Syntax :-

DELETE FROM table_name
WHERE some_column=some_value;

Delete All Data

We can delete all rows in a table without deleting the table ,that’s means table structure ,attributes and indexes will be same.

DELETE FROM table_name
or
DELETE * FROM table_name

DELETE Statement in SQL SERVER 2008 DELETE Statement in SQL SERVER 2008 Reviewed by NEERAJ SRIVASTAVA on 10:52:00 AM Rating: 5

No comments:

Powered by Blogger.