In this article I will share the script that I use while dropping a table from an existing publication.
Below is the script that helps us achieve the same.
use [databasename]--Name of the DB in replication go exec sp_dropsubscription @publication=N'NameOfPublication', @article=N'TestTable',--name of the table to be dropped @subscriber=N'all' go use [databasename] go exec sp_droparticle @publication = N'NameOfPublication', @article = N'TestTable',--name of the table to be dropped @force_invalidate_snapshot = 1 go
Technical reference:
The details for the stored procedure sp_dropsubscription can be found in the below link
http://technet.microsoft.com/en-us/library/ms184385.aspx
Tagged: Articles, Drop an Article, Microsoft SQL Server, NameOfPublication, SQL, Transact-SQL, Transactional Replication
Leave a Reply