SQL Server Management Studio is an application included with your SQL Server database engine. It has a code editor where you edit data in your database tables. The main command used to edit data in your tables is the "update" statement. This changes the data in your tables permanently. The Management Studio provides a colour-coded editor, so you can write your update statements and recognise each SQL keyword in your code.
- Skill level:
Other People Are Reading
Click the Windows "Start" button and select "All Programs." Click "SQL Server" in the list of program groups and then click "SQL Server Management Studio" to open the software.
Right-click the database on the left side of the window and select "New Query." This opens the editor where you write SQL commands against the database.
Create your basic update command. The following code is the basic update command:
In this example, the customer table updates and sets the first name for each customer as "Joe." This command changes all records in the table, so you add a filter to the update statement to change the data only in records specified.
Add a filter to the update statement. Most update statements aren't meant to change every record in the table, so you add filters to update only a few records. You apply a filter using the "where" clause. In this example, the where clause filters out all records except those customers with the last name of "Smith." The following code shows you how to apply a filter to the update statement:
Press the "F5" key to execute your statement. After the "F5" key is pressed, the statement executes and your table records update.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for