Join Simon Allardice for an in-depth discussion in this video Writing UPDATE statements, part of SQL Server 2008 Essential Training.
- View Offline
- Exercise Files
Well just about as often as inserting information you're going to need to…update information too.…Let say the example that I was looking at, I know that I've got a problem…with one of these rows.…This last row here a ProductCategoryID 55 should have had a…ParentProductCategoryID of 1 instead of 2.…So let's see how to go ahead and do a simple example like that.…We will use the word UPDATE and we're going to pick the table name, which is in…this case SalesLT.ProductCategory.…And just as SELECT has a FROM and INSERT has INTO, UPDATE has a SET.…
We're going to SET.…We want to say what the values that we want to change are.…In this case it was actually ParentProductCategoryID.…IntelliSense is smart enough to know that if we're working with the…ProductCategory table these are the only options that we have.…And then I can say and in this case I'm going to do quite a specific change SET…ParentProductCategoryID equal to 1.…But if I were to run this code right now it would update every single row in…the ProductCategory table and set back column to one, which is certainly not what we want.…
- Using T-SQL (Transact-SQL)
- Managing databases with SQL Server Management Studio
- Understanding database normalization
- Using SELECT statements
- Building indexes
- Monitoring database size and integrity
- Backing up and restoring databases
- Creating functions and stored procedures
- Managing database permissions
- Creating and formatting reports
- Adding charts to reports
- Creating and executing a simple SSIS package
Skill Level Beginner
1. Getting Started
2. Installing SQL Server 2008 R2
3. Tools and System Databases
SQL Server system databases2m 22s
4. Creating Databases
5. Importing Existing Data
6. Retrieving Data with SQL
7. Inserting and Updating Data
8. SQL Functions
9. Stored Procedures and Transactions
10. Core Administration Tasks
11. Backing Up and Restoring
12. Security Features
13. Reporting Services
14. Integration Services
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.