Thursday, March 22, 2012

Default conflict resolver in Sql 2000

Hi, I'm replicating a database between two instances of Sql 2000 using Merge Replication. I have no custom resolvers at present but I'm seeing something unexpected.

If I change the same record in both databases at the same time, but the changes affect different columns then I thought the changes would be merged and there would be no conflict because the changes were in different columns. What I actually see is a conflict and hence the publisher is winning and pushing it's changed row to the subscriber.

Have I got this wrong, will a conflict occur if the same row changes regardless of the columns updated?

Regards

GrahamCould it be the timestamp column that is causing the conflict? When I set up the publisher I simple published all tables and sp.

Is there any way in enterprise manager establishing what columns conflicted?

Thanks

Graham|||Merge replication can track conflict at row level or column level. It looks that you wanted to track conflicts at column level but set it up at row level.

You can launch conflict viewer to see the conflicts. From Enterprise Manager, if you right click the publication, there should be a menu called View Conflicts.|||Thanks for the reply.

I do have it tracking conflicts at column level. However, I did a little more digging, this is what I found...

I have a published table with two int columns, A and B. The initial data looks like:

A B
--
1 2

If on the publisher I update column A to a value 2 and on the Subscriber I update the same row but Column B to a value 3 the a merge happens and the result is that the pub and the subscriber looks like:

A B
--
2 3

If however, on the publisher I update both columns to A=3 and B=3 (net result only column A has changed) and on the subscriber I again update both columns to A=2 and B=4 (net result only column B changes), I then get a conflict as the agent thinks both A and B have been changed on the publisher and the subscriber.

I was expecting the net results to be sent when the merge agent runs, but it seems to send all the data regardless of whether any column data was changed or not.

Is this behaviour normal?

Regards

Graham
|||Hi Graham,
Yes this is the expected behavior.
Once a column is touched (to the same value or the new value) it will be sent to the other side.
However if you touch the same column multiple times, only the net effect is sent.

No comments:

Post a Comment