views:

20

answers:

1

Replication related issue,

I am explaining my architecture .

I have created , its transactinal replication process

  1. 2 Publisher on table vendors script I have given below,
  2. A Distributor
  3. 2 Subscribers

Data replication set up is like this as :

Table VENDORS gets replicated from 2-publishers to 2-subcribers via-Distributor.

While replication, ERROR issued in Distributor database as :

Here, What must happen is

Pub1 (creates pubs table vendors) –> inserts (vendors) data to Distributor. -> pull by subscribers

What is happening now for me is ,

Pub1 (creates pubs table vendors-done) -> Throws error at distributor database as

Replication-Replication Distribution Subsystem: agent abc-serv1\PRD01-star-star Billing-PROD-VREPL1\REPL01-25 failed. Violation of PRIMARY KEY constraint 'PK_vendors'. Cannot insert duplicate key in object 'dbo.vendors'.

Error is issued while operation is done between Publishers to Distributor.

A: 

The Primary Key at the Publisher has to be maintained at the Subscriber when using Transactional Replication. It sounds as though a record with the given key value already exists at the Subscriber.

From your topology description you have two separate Publications.

So:

  • Subscriber 1 receives Publication 1
  • Subscriber 2 receives Publication 2

Is there any crossover i.e. can Subscriber 2 also receives Publication 1. If so then you will encounter Primary Key conflicts unless you manage the key ranges on both Publishers or use an alternative Replication technology, such as Merge Replication.

John Sansom
There is no crossover,and the there is no entry at subscriber, at distribution process itself it throws the error. the prime goal is i have one table named ABC_tab_repilca which as identity,PK values where it must be replicated through transaction replica, my envi must be as i specified , 2 pub - 2 sub using Distribution database , any operations in table ABC_table_replica must replicated from pub-1 to sub-1 and pub2 to sub-2. The problem occurs is publication is created for PUB=1 and creates in Distribution, AGAIN the PUB=1 entry inputs in distribution ,might this throws PK violation error.
Dhiva
My need is table name : ABC_tab_replica - contains records it has PK, identity values :1. PUB = 2 created for this table ABC_tab_replica Transactional method is used, via distributed database2. SUB =2 created for this table ABC_tab_replica ABC_tab_replica table must contain data sync in main database and replicated database
Dhiva