Tuesday, November 22, 2005

Drop merge articles

One of the dilemas that most DBA's face is problem with dropping merge articles without dropping the subscribers. Microsoft will recommend to drop the subscriber and then drop an article. I came accross were you would be able to trick SQL Server and drop artcles without dropping merge replication. In most cases it worked for me and I am sure it will work for you too. The following are the codes just to do this (I don't recommend using this on production server and please backup your database before running this):

use PublisherDBName
update sysmergepublications set snapshot_ready = 0
exec sp_dropmergearticle @publication = 'NameofPublication', @article = 'NameofArticle',@force_invalidate_snapshot = 0
update sysmergepublications set snapshot_ready = 1

No comments: