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.'
-
There should not be a confligt - this computed column should not be replicated at all.– TomTomCommented Apr 11, 2018 at 16:00
-
If the computed column is not replicated, then it doesn't make it to the subscriber. I'm intentionally generating conflicts (in other columns) to verify the resolver is working as intended.– JasonCommented Apr 11, 2018 at 16:13
-
But it still akes no sense because it can be reliably computed on the subscriber.– TomTomCommented Apr 11, 2018 at 16:18
-
The resolver runs at the publisher (supposedly by IIS) in web based merge replication. But you're right that it makes no sense, the computed column shows up in the conflict table without an issue,and is available at both the subscriber and the publisher. It should just be an easy comparison to decide which row wins.– JasonCommented Apr 11, 2018 at 16:19
-
Did you ever think there might be too many sub.stackexchange sites? ugh.– JasonCommented Apr 11, 2018 at 16:27
1 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.
-
2You have a lot of typos in your answer. Please fix those so it's easier to understand what you mean. Commented Feb 25, 2021 at 11:36