Friday, 24 February 2012

Conflict 'missing key', but the key is there !

Hello,
I use a merge replication and I can see many conflicts (in differents tables) having the same source error. The error message in Conflict viewer says:
The row was inserted at 'Publisher.DataBase' but could not be inserted at 'Subscriber.DataBase'. INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Table1_Table2'. The conflict occurred in database 'DataBase', table 'Table2', column 'ColKe
y'.
But I can see on Subscriber.DataBase, on Table2 that I have the row with the key that was reported as /missing' !!!
What this could means?
Does it means that SQL try to insert the new lines first in Table1 and after this insert in Table2? Is that possible if I have defined a relation between the 2 tables ?
Thanks in advance
Catalin,
firstly let me confirm:
are the two tables are articles in the same publication
have the PK and the FK been added at the publisher before synchrionization
after synchronization does the PK value make it to the subscriber (assuming
above is true)
Really the order should be OK, although there are known issues if you have
made a lot of changes
(http://support.microsoft.com/default.aspx?scid=kb;[LN];307356). The
recommended solution in the article is to increase
the -UploadGenerationsPerBatch parameter.
Regards,
Paul Ibison

No comments:

Post a Comment