Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Is it possible to replicate a trigger but prevent it from running during synchronisation?

$
0
0

We are using SQL Server 2008r2 as the publisher and Express editions as subscribers, with merge replication and pull subscriptions.

A replicated table has an update timestamp, as a datetime column. Its default value is GETDATE() and the table has a trigger to update the date whenever anything else in the row changes.

We need this trigger to exist and update the timestamp both on publisher and subscribers, so we can't use NOT FOR REPLICATION for it.

However, whenever the subscriber synchronises, the timestamp on all rows gets updated to the synchronisation time, while we want it to be the same value that exists on the publisher (unless the subscriber changes the row).

Is it possible to replicate the trigger but prevent it from running during synchronisation?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>