SQL Server: Delete Command
In this article i will explain what is Delete command and how to use Delete command in SQL Server.
In previous articles i explained How to create a table in SQL Server, How to alter table column in SQL Server, How to add a column to table and How to delete a column from table in SQL Server, How to rename a column and How to rename a table in SQL Server, and Update Command. Now i will explain what is Delete command and how to use Delete command in SQL Server.
Here i'm using Employee table.
Delete command is used to delete particluar records from table. While deleting records we can specify conditions in where clause. Where clause is optional.
Delete from <table-name>
Delete from <table-name> where <column-name> = <value>
Delete from Employee where EmpNo = 4
Execute the above statement.
- If we omit the where condition all the records will be deleted.
- Records will be deleted in sequential manner.
CreatedSep 22, 2013
UpdatedSep 22, 2013