Follow this easy step by step tutorial to learn how to use Delete query in SQL server and see how table data can be removed.
Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
/ ithowtovids - our feed
/ howtechtv - join us on facebook
https://plus.google.com/1034403827176... - our group in Google+
Database users are often required to remove records from the database tables. For this purpose, Delete query in SQL Server is used. It removes the pre-existing records from the tables.
In this tutorial we will learn to use Delete query in SQL server.
Step 1- Viewing Table Data
The Delete query in SQL can be used for two purposes. It can be used to delete any specific row from the table as well as delete all the data records from table.
To delete a specific row, we have to specify a reference with a Where clause. Any field can be made as reference, but here we will use a Number entity for it.
For that we will be required to see the records of the table, by entering the following query in Query Editor:
Select * from EMP
and press F5 to execute.
Step 2- Inserting a reference
Now if we want to delete the record of Jones, we may use a where clause and specify its Employment No. as a reference. For that the query would be:
Delete from EMP
Where EMPNO=7566
Step 3- Record Deleted
Let us fetch all records of Employee table once again, and we can observe that Employee No. 7566 no longer exists in the query result.
And this is how we can use Delete query in SQL Server.
Смотрите видео How to Delete Query in SQL онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Internet Services and Social Networks Tutorials from HowTech 29 Май 2013, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8,87 раз и оно понравилось 3 людям.