0

In my Production Server i have replication which working fine, i do have Distributed Database which as 2 subscriber db . My data is replicated from Production envi (working fine) but while data gets replicated to Distributed database in Subscriber it throws an Error

Err msg =
Replication-Replication Distribution Subsystem: PRD01-XYZ-VREPL1\REPL01-25 failed. Violation of PRIMARY KEY constraint 'PK_vendors'. Cannot insert duplicate key in object 'dbo.tabname'.

Dhiva
  • 221
  • 1
  • 4
  • 6
  • Dhivagar : Did you get the answer you were looking for? If so, could you please accept it? If not, could you clarify what you are still looking for? Usually, the more information you provide, the more likely it is someone can help you. – Jeff Maass Jul 01 '10 at 00:42

1 Answers1

0

I haven't done this in a while, but here is a stab.

First, I wouldn't mind seeing the records which aren't matching, so I would try something like this:

--to be run on the publisher
select pub.*, sub.*
from 
    db_name1.dbo.tabname pub
    JOIN linked_server_to_subscriber.db_name1.dbo.tabname sub
        ON pub.pk = sub.pk
WHERE
    pub.some_field != sub.some_field

Hopefully, for "some_field", there is another unique column, or perhaps a dt_entered, or perhaps a rowguid. :).

Finally, if the logic of your situation involves records being inserted into the subscriber table other than by replication, and the type of replication is not merge, you may very well continue to have problems like this.

Good luck.

Jeff Maass
  • 3,632
  • 3
  • 26
  • 30