SQL Server 2008 MERGE Statement (Video Tutorial)

Leave a comment (1) Go to comments

MERGE is a new DML statement in SQL Server 2008. MERGE allows you to perform simultaneous UPDATE, INSERT and/or DELETE operations on one table. There are new physical operators that combine these operations so that they can be performed in a single scan rather than multiple scans. Microsoft have implemented the ISO SQL 2003 and 2007 standard MERGE statement (as seen in Oracle and DB2) and added some extensions of their own.

Below are the three different matched clauses in MERGE:

  • WHEN MATCHED THEN
    • Rows that meet the criteria
  • WHEN [TARGET] NOT MATCHED THEN
    • Rows that do not match with another row in the target table
  • WHEN SOURCE NOT MATCHED THEN
    • Rows that do not match with another row in the source table

SQL Server 2008 MERGE Statement – Video Lesson


Video Source : Ashish Jaiman, msdn.com


In summary, SQL Server 2008 introduces the MERGE statement which will allow users to perform insert, update and delete operations in a single statement.

EOF - SQL Server 2008 MERGE Statement (Video Tutorial), SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000
Leave a comment

1 Comments.

Leave a Reply

Your email address will not be published. Required fields are marked *


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Trackbacks and Pingbacks: