Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Duplicate key inserting row to subscriber

$
0
0
Greetings, have transactional replication set up and has been working for over a year now. Publisher and distributor on same SQL 2008 R2 with the publication database still 2000 (all in the process of upgrading). Multiple subscribers, they are 2008 R2 servers and databases. A publication was added 4 months ago, has 3 tables in the publication, 2 type tables and one detail table, the details table has been adding rows from the publisher to subscribe since it was set up, no problem. Yesterday we inserted a row into one of the type tables on the publisher and started getting an error "Error executing a batch of commands. Retrying individual commands. Violation of PRIMARY KEY constraint Cannot insert duplicate key in object" and the undistributed commands started piling up. Eventually I initialized this subscription to "fix" it and get the row over there. I have a test environment set up and I am getting the same error there when I go through the same steps.  Its a simple insert statement, table has a primary key of a char(1) and another column char(60). if I insert the row to the publisher it works fine on the publisher, but it gets a dup pk on the subscriber and the row is not there on the subscriber when I run a select. Ultimately the distribution agent gets hung up with the "Error executing a batch of commands" and "Violation of PRIMARY KEY constraint Cannot insert duplicate key in object" and continues retrying. I can run a trace and see all this on the subscriber, I am at a loss where else to look to resolve. It seems a straight forward error, any suggestions? Thanks.

Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>