Suppose that you have a SQL Server 2005 database on your PC, and suppose that this database has a table with a column classified as "unique" (so it's impossible for this table to contain 2 records having the same value in this column).
Suppose that you publish this database and you create 2 SQL Server Mobile 2005 subscriptions on 2 Pocket PCs.
Suppose now that the first PPC (using an embedded program) creates a record with a certain value for the column (and adds it to the table), and the second PPC makes the same thing (it inserts a record with the same column value of the first PPC).
At this point, you connect the 2 PPCs to your PC (one by one, of course), to synchronize (using merge replication) the databases...
WHAT HAPPENS? Does an error raise?
Must you give a publication setting in which you say that, if this situation occurs, PC SQL Server holds the last (or the first, as you decide) record acquired? Is it possible?
Thank you very much
Of the two subscribers, the 1st will successfully sync with the publisher. The 2nd subscriber will then try to upload their change, and it should fail due to constraint violation. So you now have one conflict.
If the row at the publisher needs to be downloaded to the subscriber, this will also fail due to constraint violation. So you now have two conflicts, one from the upload, one from the download.
With these types of insert conflicts, you have to manually resolve the problem: you can delete the row at the 2nd subscriber, update the row at the publisher or 2nd subscriber so column contains a new unique value.
No comments:
Post a Comment