Inside SQL Server 2008: Figure 4: Update and Insert Data with One Statement.
The MERGE statement lets you insert, update, and delete data in a table with a single statement. The results shown here show the contents of the Dogs table before merging data, the contents of the Inserted and Deleted tables, and the new contents of Dogs.