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 |
AnimalMagic
Starting Member
28 Posts |
Posted - 2007-09-06 : 11:33:33
|
I'm running into a problem which has recently just started and i cant get my head around why replication is hitting conflicts.The production db is replicating to a backup and in the agent history there are multiple rows which say "upload x data changes (x inserts, x updates,x deleted, xx conflicts) then straight after, whatever the number of conflicts where shown there is a "downloaded xx data changes (xx deletes). I havent got a clue whats going on.When viewing the conflicts they are all because of the same FK constraint which is The row was inserted at 'WCGW230.ICE_YPL' but could not be inserted at 'WCGW240.ICE_YPL'. INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'CREDIT_REPORT_DETAILS_FK_1'. The conflict occurred in database 'ICE_YPL', table 'CREDIT_REPORTS', column 'CREDIT_REPORT_ID'.When looking at the table design CREDIT_REPORTS has an identity (not for replication) on credit_report_id and this is linked to CREDIT_REPORT_DETAILS.credit_report_id as a foreign key. it seems to me it cant insert into credit report details because the header record doesnt exist, but for the first 50+ conflicts i have viewed it does exist?Can anyone shed any light on this? I would be very grateful! |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-09-06 : 23:19:22
|
Do you update both source and target tables? |
|
|
AnimalMagic
Starting Member
28 Posts |
Posted - 2007-09-07 : 03:39:20
|
No, only wcgw230 (Subscriber). I am going to change the replication to transactional replication anyway, as it is only 1 way data entry but still wanted to know what was causing these issues. it just doesnt seem to make much sense! |
|
|
AnimalMagic
Starting Member
28 Posts |
Posted - 2007-09-13 : 08:42:34
|
Just for anyone else having the same/similar issues this was purely down to the foreign keys not being setup with the NOT FOR REPLICATION option when the database was designed. Ive since had the wonderful task of writing a script to clear all the conflicts :) |
|
|
|
|
|