all groups > sql server replication > august 2007 >
You're in the

sql server replication

group:

Primary Key Violation - Transactional Replication


Re: Primary Key Violation - Transactional Replication Paul Ibison
8/6/2007 12:00:00 AM
sql server replication: I really need to know what type of transactional replication setup you have
configured - plain, updatable (immediate or queued) and nosync or
automatic....
Cheers,
Paul Ibison

Primary Key Violation - Transactional Replication JN
8/6/2007 4:06:07 AM
Hi All,

I have setup a transactional replication between 2 SQL 2005 servers.

Unfortunately, I am getting the error listed below:

Replication-Replication Distribution Subsystem: agent
JFCIS3TRM02-JFJDAT-JFJDAT_PUBLICATION-JFCIS3TRM01-13 failed.

Violation of PRIMARY KEY constraint 'ARSTRUN_KEY_0'. Cannot insert duplicate
key in object 'dbo.ARSTRUN'.

Is this error being raised because I haven't enabled automatic range
management? If so, how would I fix this error?

Regards,

JN

Re: Primary Key Violation - Transactional Replication JN
8/6/2007 11:38:08 AM
Hi Paul,

The type of transactional replication setup is just the plain one, not the
one with updatable subscription.

I am not sure whether it is nosync or automatic as I used the wizard and I
didn't recall being asked for those settings.

Regards,
JN

[quoted text, click to view]

Re: Primary Key Violation - Transactional Replication JN
8/6/2007 3:48:45 PM
That could be possible since I have created an ODBC connection to the
replicated database which an end user can select from a drop down list when
they open the application.

What do you suggest I do to get the two databases synchronized again?




[quoted text, click to view]

Re: Primary Key Violation - Transactional Replication Paul Ibison
8/6/2007 6:55:52 PM
OK - in that case my suspicion is that someone has entered a row on the
subscriber. Is that possible? In this plain transactional case the
subscriber data is supposed to be read only and only changed via the
distribution agent.
HTH,
Paul Ibison

Re: Primary Key Violation - Transactional Replication Paul Ibison
8/6/2007 9:03:27 PM
The easiest way is to reinitialize.
If this sounds too painful, you could use a tool like DataCompare from
Redgate or Adept's SQLDiff to sync up the data.
HTH,
Paul Ibison

AddThis Social Bookmark Button