Changing Existing Data with UPDATE

Use the UPDATE statement to change single rows, groups of rows, or all the rows in a table. As in all data modification statements, you can change the data in only one table at a time.

The UPDATE statement specifies which row(s) to change and gives the new data. The new data can be a constant or expression that you specify, or it can be data from other tables.

Note The UPDATE statement is logged; if you are changing large blocks of text or image data, use the UPDATETEXT or WRITETEXT statement, which, by default, is not logged. For more information, see Changing Data with WRITETEXT.

If an UPDATE statement violates an integrity constraint (if one of the values being added is the wrong datatype, or it violates a constraint that has been defined for one of the columns or datatypes involved), the update does not take place and an error message is displayed.

For details on the UPDATE statement, see the UPDATE statement in the Microsoft SQL Server Transact-SQL Reference.