From the course: SQL Server 2014 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

DELETE statements

DELETE statements - SQL Server Tutorial

From the course: SQL Server 2014 Essential Training

Start my 1-month free trial

DELETE statements

- In this section, I'm going to demonstrate how to remove rows from a table, how to remove one or more entire rows from a table by using a delete statement. So again, we're gonna work with humanresources.department. And we can explore that table real quickly by doing a select store from the table. When we execute that, we'll see all the rows returned, including the one at the bottom that we added a few exercises back. We added the database administrators record. We're gonna go ahead and delete that now. We'll open up a new query. We'll use the keyword delete. And then we don't need to specify any columns. None of the delete functionality works on a column-by column basis. It's going to delete the entire row, so we don't have to specify which columns we're trying to delete. We can jump right to the from part, and this will be from humanresources.department. But don't execute this just yet. If you execute it as is, it would delete all of the records from humanresources.department, which…

Contents