Sql-server – SQL Server Merge Replication Computed Column Conflict Resolution

merge-replicationsql serversql-server-2008-r2

I'm setting up a merge replication web publication for a table that needs to use the DateTime (Later Wins) conflict resolver so that the most recently modified row wins in any conflict. This table (and hundreds of other tables) use a datetimeoffset for their modified date as subscribers can be in many timezones. In order to get the required datetime value as a column I've added a ModifiedDateUTC datetime computed column which does a simple CONVERT to a datetime. The issue I'm seeing is that even though the article setup accepts this as a valid column, whenever I generate a conflict I get the error 'The specified conflict resolution column 'ModifiedDateUTC' could not be found.'

Best Answer

The problem is that replicate dcolumn drop from replicating. Then replicatinon of object (views, store procedures and function) fail in creating subscription. Then this column should e added manualy to table. Then after part wwich create object you should remove calculated column becaus ebcp fail with field to big error. Then after removal bcp pass. But you don't have calculate column on subscriber. But now you can do that only through publisher. Then you should drop calculate column (but this is problem if you have FK otr index on it because you shoul drop them to). Then recreate calculated column (and recreate FK and index (index manualy on subscribers too). This is not normal.

Calculated column (persisted) should be replicated by definition (SQL staements) always in creation of snapshot and only not field with bcp and realy replicated data.