Preview Content - log in or become a member

SQL DELETE Statement

In this step by step SQL Tutorial I will show you how to remove rows from a table . For the purpose of this tutorial I will use SQL Server 2012.

Other Versions of SQL Server:

  • SQL Server 2012
    • This blog post has been written using SQL Server 2012
  • SQL Server 2008 / R2
    • The examples we used should work in SQL Server 2008 and R2
  • SQL Server 2005
    • We suspect that this will work in SQL Server 2005 as well

Who is it for?

  • People who would like to learn basics of using SQL DELETE 
  • Those who are preparing for Microsoft certifications and need to cover this topic.

Content:

DELETE Introduction

Delete allows to remove rows from a table and you can write delete query with filters so you delete only the rows you want.

To better understand DELETE let's create a task that is close to real-life. In our story imagine you are a developer
that has been ask to clean your table before loading new data from spreadsheet. In the  following example I will show you how you could solve your task.

DELETE using SSMS 2012

For this example I will use AdventureWorksDW2012 database, dbo.DatabaseLog table. 



Are you a member? Log In

or check membership plans

Plans:
Bronze
Silver
Gold
6 Courses
T-SQL (3), SSRS (1), SSIS(1), Excel (1)
Watch Video
75 Mini Courses
T-SQL (34), SSRS (7), SSIS(16), + more
300+ videos and 300+ Articles
38
(part of
Courses)
Progress Tracking
21 Interview Q&As pages
T-SQL (8), SSRS (3), SSIS(4), Other (6)
Forum
11 Webinar Recordings
T-SQL (1), SSRS (9), Career(1)
1 DIY Project (beta)
70-461 Tests
Watch Video
60 days, 100% Money Back Guarantee
Instant Activation
Duration:
(one off payment,
not a subscription)
Bronze
Silver
Gold
1 month $19
sign up
$24
sign up
$29
sign up
3 months 33% off
(2 months + 1 free)
$39
sign up
$50
sign up
$60
sign up
6 months 40% off
(3.6 months + 2.4 free)
$68
sign up
$86
sign up
$104
sign up
1 year 50% off
(6 months + 6 free)
$114
sign up
$144
sign up
$174
sign up
2 years 60% off
(9.6 months + 14.4 free)
$182
sign up
$230
sign up
$278
sign up
lifetime >60% off
(12.5 months + a lot for free)
$239
sign up
$302
sign up
$365
sign up


Did you find this page useful?
+1  |  -0
(1 Votes)