SQL Server Merge statement issue
I am lear开发者_运维知识库ning and using SQL Server 2008 new Merge statement, merge statement will compare/operate source table and destination table row by row ("operate" I mean operations performed for when matched or not-matched conditions). My question is whether the whole merge process will be one transaction or each row comparison/operation will be one transaction?
Appreciate if any document to prove it.
thanks in advance, George
The merge statement is a set based operation and as such will operate on the entire set of matching rows.
It is very much like an UPDATE or DELETE. If you want to (and sounds like you do), you can wrap it with a BEGIN TRAN
and COMMIT
for data integrity purposes.
精彩评论