Tuesday, March 6, 2012

"Do not replicate DELETE statement" feature problem

I am testing SQL Server 2005.
I need a replication where "DELETE delivery format" field in Table Articles Properties is set to "Do not replicate DELETE statement". Unfortunately nothing I set in this dialog is saved and used. Doesn matter what I change the replication behaves the same and the next time I open "Table Articles Properties", every value is still default.

Am I doing something wrong or is it an issue (bug) in 2005 replication?


I googled about the issue and also searched in the SQL Server Replication threads on this site, both with no success. The thread named "Selective replication of DELETE transactions" doesn't provide enough information about SWL Server 2005 replication configuration.

Use Case:
I have a small "operational" database with live data. I need to keep a complete history for all records that ever appeared within the "operational" DB. It came to my mind that I can "easily" achieve this if I set up a replication that does not replicate a delete statement ever. I strongly prefer not to mess with the subscription stored procedures but to configer my publication properly instead.

Hi there,

When you open the "Article properties" under "Publication Properties" page, make sure you select the table that you disabled the "delete" and choose "Set Properties of Highlighted Table Article" instead of "Set Properties of All Table Articles". The properties should show up properly for the selected table article. You can also use

sp_helparticle @.publication='publication name'

to query the article setting, under the "delete_command", it should be 'NONE'. I quickly tested on a sample table, delete statements were indeed ignored. But you should do your own testing for that to make sure the behavior suits your need :-)

Regards,
Gary

No comments:

Post a Comment