Chapter 12. Updating Data from Microsoft SQL Server 2005

After completing this chapter, you will be able to:

  • Update information in your databases

  • Manage update issues by using triggers

  • Use ADO.NET components to perform update operations

Using the UPDATE Statement

You use the UPDATE statement to modify information in your data tables. The basic syntax for updates is the following:

UPDATE [<ServerName>].[<Database>].[<Schema>].[<TableName>]
   SET [<ColumnName>] = <NewValue>>
      ,....
 WHERE <Search Conditions,,>

As usual, if you execute the UPDATE sentence with a connection to the current database, you can simply use the <SchemaName>.<TableName> form without including the server and database names.

You can use the UPDATE sentence without a WHERE condition. A ...

Get Microsoft® SQL Server™ 2005: Database Essentials Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.