ColSchmoll


I can switch off replication deletes be running the following:

EXEC sp_changearticle @publication = 'PUBNAME', @article = 'ARTICLE1', @property = 'del_cmd', @value = 'NONE'

I believe I can the effectively then remove the delete stored procedure from the replicated database.

And all this wroks no problem. However, when I come to add a new article, "Article2" to my publication it also snapshots and reinitialised the "Article1". How can I prevent the snapshot agent from re-initialising "Article1".

Thanks.





Re: How do I stop replicating deletes without a Snaphot?

ColSchmoll


My apologies these tables are not being reinitialised.







Re: How do I stop replicating deletes without a Snaphot?

Hilary Cotter

drop the article from the subscription, drop the article from the publication, add it back in to the publication with the change, and then add it back to the subscription - here is the code to do it. Here I am dropping the authors table from the publication pubs and then adding it back in again.


sp_dropsubscription 'pubs','authors','MySubscriber','MySubscriptionDatabase'
GO
sp_droparticle 'Pubs','authors'
GO
sp_addarticle 'pubs','authors','authors'
GO
sp_addsubscription 'pubs','authors','MySubscriber','MySubscriptionDatabase'
GO









Re: How do I stop replicating deletes without a Snaphot?

ColSchmoll

Thanks Hilary, but it would appear then updating the article also works. Maybe this is because the article was intially created from a backup and not a snapshot.