So how can we get around re-initialization of the subscriber and new snapshot generation? We manually execute some of the replication stored procedures to remove the article and keep the snapshot from being invalidated.
First we must use sp_dropsubscription to remove the subscription to the individual article.
EXEC sys.sp_dropsubscription
@publication = '<PublicationName>',@article = '<ArticleToDrop>',
@subscriber = '<SubscribingServer>',
@destination_db = '<DestinationDatabase>'
Next, we drop the article from the publication without invalidating the snapshot. We do that by executing sp_droparticle with the force_invalidate_snapshot set to 0.
EXEC sys.sp_droparticle @publication = '<PublicationName>',
@article = '<ArticleToDrop>',
@force_invalidate_snapshot = 0
Msg 20607, Level 16, State 1, Procedure sp_MSreinit_article, Line 99
ReplyDeleteCannot make the change because a snapshot is already generated. Set @force_invalidate_snapshot to 1 to force the change and invalidate the existing snapshot.
@force_invalidate_snapshot = 1
Delete