MERGE

Using the MERGE Statement to Perform an UPSERT

  • Article

The term UPSERT has been coined to refer to an operation that inserts rows into a table if they don’t exist, otherwise they are updated. To perform the UPSERT operation Microsoft introduced the MERGE statement. Not only does the MERGE statement support the UPSERT concept, but it also supports deleting records. Greg Larsen discusses how to use the MERGE statement to UPDATE, INSERT and DELETE records from a target table.

2014-12-22

13,060 reads

Blogs

Accelerated Database Recovery in SQL Server 2019: Choose your own filegroup for the version store

By

An exciting new feature in SQL Server 2019 is Accelerated Database Recovery (ADR). Resulting...

Adding SQL Change Automation to Jenkins for Database CI

By

In a previous post, I explained how to get Jenkins running in a container...

DevOps for the DBA, Slide Deck

By

I have an all day seminar I give called “DevOps for the DBA”. If...

Read the latest Blogs

Forums

Multiple tables created in CDC

By DBA_007

Hello Team, I have enabled CDC for a particular database in SqlServer and enabled...

2 core machine with 4 Tempdb files

By AlphaTangoWhiskey

Just curious if there is a performance hit by having 4 tempdb files with...

User datareader access problem

By jay-h

I went to give a user (via AD account) datareader access to a number...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers