Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


SQL Server 2000

Modifies existing data in a table in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE).

UPDATE table_name 
   { column_name = { expression | DEFAULT | NULL } } [ ,...n ] 
   [ WHERE < search_condition > ] 
Is the name of the table to update.
Specifies the list of column or variable names to be updated.
Is a column that contains the data to be changed. column_name must reside in the specified table and should be specified only once in the SET clause.
Is a variable, literal value, or expression that returns a single value. The value returned by expression replaces the existing value in column_name.
Specifies that the default value defined for the column is to replace the existing value in the column. This can also be used to change the column to NULL if the column has no default and is defined to allow null values.
Specifies the conditions that limit the rows that are updated.
< search_condition >
Specifies the condition to be met for the rows to be updated. There is no limit to the number of predicates that can be included in a search condition.

Identity columns cannot be updated.

If a WHERE clause is not specified, all rows of the table are updated.

The search condition in the WHERE clause is evaluated for each row of the table before updating any row of the table.

If an update to a row violates a constraint or rule, if it violates the NULL setting for the column, or if the new value is an incompatible data type, the statement is canceled, an error is returned, and no records are updated.

All nchar columns are right-padded to the defined length.

All trailing spaces are removed from data inserted into nvarchar columns, except in strings containing only spaces. These strings are truncated to an empty string.


The following example changes the shipping address in the Orders table of the Northwind database for all orders made by the company with the customer ID of VINET.

UPDATE Orders SET ShipAddress = '21 rue de l''xylophie' WHERE CustomerID = 'VINET'

© 2015 Microsoft