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 - 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. - Details
When updating data across multiple tables, you might encounter this error if there are duplicate entries.
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 only showing one table to update and two tables to delete from.
-- To update the values
Update AnotherTable set BMID = 126 where BMID = 533
Delete from Members where BMID = 533
Delete from AnotherTable where BMID = 533

Share With Friends (Updated 6-8-2010)
Recent Articles
- The MERGE statement attempted to UPDATE or DELETE the same row more than once. 0
- The page request was made over HTTP 0
- SQL Server Management Studio message 3014. The step failed 0
- Wi-Fi Connection to the inernet keeps dropping when connected to local network. (Not connected to ISP network) 0
- Invalid attempt to call MetaData when reader is closed. 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