From the course: Learning Microsoft SQL Server 2019

Unlock the full course today

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

Write an UPDATE statement

Write an UPDATE statement - SQL Server Tutorial

From the course: Learning Microsoft SQL Server 2019

Start my 1-month free trial

Write an UPDATE statement

- [Instructor] Using a query we can update the data that's stores in our data tables. This'll require the use of a new keyword that we haven't seen yet called update. First, I want to review the information that's stored in the Sales.SpecialDeals table inside the WideWorldImporters database. I'll scroll down til I find it, and then right click on it and choose select top 1000 rows. And this table only has two records currently. You can see those down here in the results section. The first record is a discount that's going to be applied to a company called Wingtip Toys. On the far right you can see the starting and end dates for this discount. You can see that it currently ends on 3/31/2016. And we have this deal description here of 10% for the first quarter for USB Wingtip. So let's suppose that this discount has been renegotiated and should continue to apply until the end of 2019. We'll need to update the values in the end date column and the deal description columns. But we only…

Contents