What is the Merge Statement in SQL Server ?

MERGE is a new feature that provides an efficient way to perform multiple DML operations in a single statement. In previous versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions, but now, using MERGE statement, we can include the logic of such data modifications in one statement that even checks when the data is matched, then just update it, and when unmatched, insert it.

One of the most important advantages of the MERGE statement is all the data is read and processed only once.



You May Interest

Adding Columns to a Table with a Query in MS SQL

What is CHECKPOINT Process in the SQL Server ?

What is Partial Cache Mode in SSIS ?

What is the Difference Between Clustered and a Non-clustered Inde ...

Getting List of All Stored Procedures in Database in MS SQL