SQL-Server-Delete .

In this session i have discussed the SQL Server Delete keyword .


The SQL Server Delete keyword is used to remove the existing records in table .


Delete All Record at a time

    DELETE FROM Table_Name 
    


Delete Specified Record at a time

    DELETE FROM Table_Name WHERE Condition
    


Database Demo

The following data shown by Employee table of abc database .

EmpID EmpName EmpCity EmpEmail
1 Amit Noida amit@gmail.com
2 Amita Noida amita@gmail.com
3 Amita Delhi amita123@gmail.com

Delete Example .

The below sql code delete the one record at a time the EmpID=3 in the table .

    DELETE FROM Employee WHERE EmpID=3
    

The output is look like below .

EmpID EmpName EmpCity EmpEmail
1 Abhishek Gorakhpur amit@gmail.com
2 Amita Noida amita@gmail.com

.


The below sql code delete all the record in the table .

    DELETE FROM Employee 
    

Welcome to AndroidATPoint.

back image                     next image