Introduction:

In this article we will explain how to delete existing record from the table in SQL Server with example.

Description:

The SQL DELETE keyword is used to delete the existing records from a table.

You can use WHERE clause with DELETE query to delete specific records.

DELETE FROM table_name [WHERE condition];

But if you do not want the WHERE condition it will remove all the rows from the table.

DELETE FROM table_name

Example:

The Following SQL Statement selects all Records from Student Table.

select * from Student

Result:


Use Delete Keyword in SQL Server

DELETE Keyword

The following SQL statement delete students whose name is  Mukul Lohar.

delete from Student where Name='Mukul Lohar'

after executeing delete query we execute againg select query see below  'Mukul Lohar' record is deleted.


Use Delete Keyword in SQL Server


if you do not want the WHERE condition it will remove all the rows from the Student table.

 delete from student


I hope this article will help to you.

0 comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like