CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
The MERGE statement attempted to UPDATE or DELETE the same row more than once.
- Article ID:
7293 - Date Created
Sunday, February 15, 2026 - Last Updated
Sunday, February 15, 2026 - This Article Has been Viewed
0 times - Short Desc
When merging data between tables in SQL Server, multiple rows may be sent simultaneously. This is not allowed and will cause the 'MERGE statement attempted'. - Article Details
Whether you are running a Script in SQL Server Management Studio, or in a website running ASP Classic or ASP.NET. If your table contains multiple rows that are of the same value, this will cause your Script to receive the following error.
Msg 8672, Level 16, State 1, Line 18
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 group the source rows. - Recreate Issue
The following code sample will give the "MERGE statement attempted" error.with s1 as (SELECT mt.ITTempID, COALESCE( - Resolve Issue
To correct the issue, we need to add a TOP 1 to our Main Select Statement.
In your code, add this to the Statement that wraps all other code.with s1 as (SELECT top 1 mt.ITTempID, COALESCE(
Review this KB Article to further resolve this issue.
--------
Related Articles
The MERGE statement attempted to UPDATE or DELETE the same row more than once.«

Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24959
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21730
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19809
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 18295
- The backup set holds a backup of a database other than the existing 17094