all groups > sql server replication > march 2005 >
You're in the

sql server replication

group:

Avoiding "Violation of Primary Key" with replication


Avoiding "Violation of Primary Key" with replication dkolva NO[at]SPAM atlab.com
3/14/2005 7:57:49 AM
sql server replication: I have a centralized database (server A), and two remote databases
(server B & C) all with a copy of the same database with a table with
user entered, primary key like ProductID. There is a possiblity that
the same ProductID gets entered into both B & C (which is ok).

I create a snapshot of B and replicate to A.

Is there a way to replicate C to server A and have replication ignore
any Primary Key violations during replication?
Re: Avoiding "Violation of Primary Key" with replication Hilary Cotter
3/14/2005 12:41:31 PM
you can select the continue on data consistency profile. To do this right
click on your distribution agent and select agent profiles.

I would however advise you to come up with some partitioning scheme -
whether this involves adding another column to your pk with a location
specific parameter, or if you are using the identity property on you pk, go
to server b and type

DBCC Checkident ('YourTable',1000000)

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

[quoted text, click to view]

AddThis Social Bookmark Button