Groups | Blog | Home
all groups > sql server replication > august 2006 >

sql server replication : Stop deletions propagating to subscribers in merge replication


rastan9 NO[at]SPAM hotmail.com
8/6/2006 6:20:08 PM
Merge replication is taking place between hand held clients running
SQLServerCE (anonymous subscription) and a SQL Server 2000 box. We
have a stored proc that executes nightly (scheduled job) archiving
records older than 90 days on the SQL Server 2000 database. What we
have been finding is that users that have collected data prior to this
nightly job will have increased volume of data transmitted during their
merge replication at the end of the next day. It seems that when
performing the merge of data, the server is transmitting to the
subscribers info about the records archived overnight. Is there any way
to stop these deletions being sent to subscribers, as users merging
info over dial-up are taking extremely long times to complete updates
under these increased volume conditions.
With transactional replication a stored proc may be written and
replicated to the subscribers to delete the archive records on the
devices. This replaces the need to send hundreds of individal
transaction deletion rows to the subscribers.

Can anyone help in outlining the best way of achieving this in a MERGE
replication suituation.

Thanks in advance
Paul Ibison
8/7/2006 12:00:00 AM
Please take a look at the parameter @delete_tracking. Execute
sp_changemergearticle (Transact-SQL) at the Publisher on the publication
database. Specify a value of delete_tracking for @property, and a value of
false for @value. This looks like what you need.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

rastan9 NO[at]SPAM hotmail.com
8/7/2006 4:06:09 PM
Paul, out of interest.
Is there a way to apply these settings without needing to delete and
re-apply the publication script?
There is really no single point in time when all data from units are
merged. If we remove and re-establish publication whilst we have
outstanding non-merged units in the field. we lose the ability to sync
these units.
Thanks

[quoted text, click to view]
Paul Ibison
8/8/2006 9:28:10 AM
It's impossible to tell from the documentation, so give it a go in a test
environment. If it is viable, I'd be concerned about ensuring that nobody
can alter the data on the subscriber. The other posibility is somehow
partitioning the table on the publisher and placing the partitioned tables
in different publications. Another thought is to use dynamic filters. In
this scenario you could use logical deletes (bit flag) and partition the
data using -HOSTNAME. Data could be removed logically from the partition
before the logical delete.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

AddThis Social Bookmark Button