Sunday, March 1, 2009

What is Upsert?

Upsert provides the following SQL functionality:

If something does not exist in a table then insert it. If it exists then update it.

This is something like what happens when you move a file to a folder, if the file exists it will ask you whether you want to replace it with a new version or not. If the file does not exist it is inserted, no questions asked.

This is implemented by MERGE in SQL Server 2008

No comments: