|
|
| |

How do we handle duplicate primary keys for transaction/merge replication?
Answer:
If you use transaction replication then Log Reader Agent read
transaction log and all transactions for replication will be transferred
into distribution database as Insert, Update and Delete commands.
So, if you try to insert the record with existing primary key you will
receive duplicate primary key error and new record will not be inserted.
How can you handle this? For transaction replication there is no way to
handle this error. You should resync your databases or correct records
manually, in this case. This error can be handled only in merge replication.
Read about "Conflict Resolution", Title "Merge Replication" in
SQL Server Books Online. It's therefrom:
When conflicts occur, the agent initiates an automatic reconciliation.
The "winner" of the conflict can be based on a user-specified priority
scheme, a "first wins" solution, or a custom resolution using COM
and stored procedures.
|
|
|
|