Tuesday, 27 July 2021

The MERGE statement attempted to UPDATE or DELETE the same row more than once.

Hi All,

 The MERGE statement Error in SP - Sh 

The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause 
 
To resolve this error, we have to check the ON clause of our main MERGE statement. We have to try changing the OR condition to AND condition and vice versa 

 

No comments:

Post a Comment