Avatar of motioneye
motioneye
Flag for Singapore asked on

Push transactional replication fail with violation of primary key

Hi,
I'm running transactional replication, distribution agent found fail due to the last action was duplicating, what should I do now to solve this kind of problem?
Microsoft SQL Server

Avatar of undefined
Last Comment
imran_fast

8/22/2022 - Mon
Aneesh

EugeneZ

what is your sql server(s) version\edition\SP?
EugeneZ

also check:
http://www.replicationanswers.com/General.asp
See related problem and solution:

"How to....... have 2 publications with one table in common?  "
 
--------------------------------------------------------------------------------
 
  The same table may be added to each publication. However, one of the publications will need to be set up as a no-sync and if you are using automatic range management you'll receive a PK error like this:

Violation of PRIMARY KEY constraint 'PK__MSrepl_identity___4D5F7D71'. Cannot insert duplicate key in object 'MSrepl_identity_range'.

So, on the upload-only publication you'll just need to disable automatic range management for your table article
 
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
imran_fast

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question