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:
7291 - Date Created
Monday, February 2, 2026 - Last Updated
Sunday, February 15, 2026 - This Article Has been Viewed
0 times - Short Desc
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. - Article Details
When updating data across multiple tables, you might encounter this error if duplicate entries exist.
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
Scenario #1:
This error will happen if you have a SQL Script that joins tables together based on either a Number or Word(s), in which the tables have multiple instances of the value, when they are only supposed to have one instance. - Resolve Issue
Scenario #1:
Run the following Script on each table to identify all duplicate values. Then run an update Script to correct the entries, and a delete Script to remove all dead entries ONLY after you have updated the original value with the duplicate values' content.
-- To find duplicate values in a table.
SELECT MemberName,COUNT(*)
FROM Members
GROUP BY MemberName
HAVING COUNT(*) > 1
Example of records found.
126 Darrell_Roberts
533 Darrell_Roberts
In the live data example above. We checked and found that record 126 contains all the data, while record 533 contains only a single record.
We then updated the 126 to retrieve the 533 value across all relevant tables.
In this example, we are showing only one table to update and two tables to delete.
-- To update the values
Update AnotherTable set BMID = 126 where BMID = 533
Delete from Members where BMID = 533
Delete from AnotherTable where BMID = 533Fix Your Code
You will need to find out why duplicate records are created. This is the root cause: if you are creating a table set that uses this type of code, all records must be unique.
Review your initial database insert code and troubleshoot the issue causing duplicate records to be inserted.
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
- Microsoft OLE DB Provider for SQL Server (0x80040E21) Multiple-step OLE DB operation generated errors 0
- Microsoft Store Crashed and cannot force it to shutdown in task manager 0
- The MERGE statement attempted to UPDATE or DELETE the same row more than once. 0
- BC30205: End of statement expected. 0
- The MERGE statement attempted to UPDATE or DELETE the same row more than once. 0
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