Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rama_arumugam
Starting Member
2 Posts |
Posted - 2006-04-21 : 03:16:02
|
Hi, I have few databases with SAME database structure in SQL Server 2000 in different locations. Data will be updated in different places with different sets of data. DB : SQL Server 2000 OS : Both are running on Windows XP for testing purposes.I managed to setup the replication and managed to start the replication. But, it says primary key problem - violation of primary key.Where to set so that i can replicate many times using the same source database and can resolve this problem automatically? Now, it just stops when the error happens.Error as below : The process could not deliver the snapshot to the Subscriber.(Source: Merge Replication Provider (Agent); Error number: -2147201001)---------------------------------------------------------------------------------------------------------------The process could not bulk copy into table '"dbo"."OPDailyReception"'.(Source: ARUPC (Agent); Error number: 20037)---------------------------------------------------------------------------------------------------------------Violation of PRIMARY KEY constraint 'PK_OPDR'. Cannot insert duplicate key in object 'OPDailyReception'.(Source: ARUPC (Data source); Error number: 2627) |
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-04-21 : 03:45:56
|
the error is telling you that...your source data has duplicate pk on the destination and since you have the constraint for primary key, the copy failsyou can start the snapshot but make sure that options is to delete the content of the destination tables, you can check at the publication properties for each articles...--------------------keeping it simple... |
 |
|
rama_arumugam
Starting Member
2 Posts |
Posted - 2006-04-25 : 06:21:40
|
Dear friend... First of all thank you very much for all your effort in finding the solution.I have 2 publisher namely TH1, TH21 subscriber : THFinalI've created 2 individual publications using "Create Publication" and published database namely TH1 and TH2.Publication type : Merge publicationDefault table article properties setting are as follows :a. When merging from different sources : "Treate changes to the same column as a conflict (changes to different columns in the same row will be merged)".Snapshoti Choose "DELETE DATA IN THE EXISTING TABLE that matches the ROW FILTER statement".Resolver : I checked "yes" for - Allow Subscribers to resolve conflicts interactively during on-demand synchronizations".Now, when i sync the TH1, all the records from TH1 goes to the subscriber database "THFinal". When i sync the TH2, all the records which was synched earlier (from TH1) being DELETED. and all the records from TH2 goes to the subscriber database "THFinal". Basically, i WANT to retain the ALL THE data from in "THFinal" which came from TH1 database since the primary key is different. Also, all the database contains running no (Identity increment = 1) . Will it cause any havoc when replicating since running no will be same in TH1 and TH2 even though the primary keys for the table is unique?Thank you. |
 |
|
|
|
|
|
|