4.3. Modify Data

SQL Server 2008 supports four primary data modification keywords: INSERT, DELETE, UPDATE, and MERGE. As their names imply, each modification statement is targeted to a specific modification activity. Let's look at each of them in turn and see how to apply them.

NOTE

The MERGE keyword is useful when you want to perform multiple operations such as INSERT and DELETE operations concurrently. However, since it requires more advanced knowledge of TSQL code, we have left it out of this discussion. If you are interested in this feature, it is well documented in SQL Server Books Online.

4.3.1. Insert Data

You use the INSERT keyword to add data to an already existing table. The simplified syntax looks like this (remember that square ...

Get SQL Server® 2008 Administration: Instant Reference 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.