Drops an article from a snapshot or transactional publication. An article cannot be removed if one or more subscriptions to it exist. This stored procedure is executed at the Publisher on the publication database.
sp_droparticle [ @publication= ] 'publication' , [ @article= ] 'article' [ , [ @ignore_distributor = ] ignore_distributor ] [ , [ @force_invalidate_snapshot= ] force_invalidate_snapshot ] [ , [ @publisher = ] 'publisher' ] [ , [ @from_drop_publication = ] from_drop_publication ]
sp_droparticle is used in snapshot and transactional replication.
For horizontally filtered articles, sp_droparticle checks the type column of the article in the sysarticles (Transact-SQL) table to determine whether a view or filter should also be dropped. If a view or filter was autogenerated, it is dropped with the article. If it was manually created, it is not dropped.
Executing sp_droparticle to drop an article from a publication does not remove the object from the publication database or the corresponding object from the subscription database. Use DROP <object> to manually remove these objects if necessary.
DECLARE @publication AS sysname; DECLARE @article AS sysname; SET @publication = N'AdvWorksProductTran'; SET @article = N'Product'; -- Drop the transactional article. USE [AdventureWorks2012] EXEC sp_droparticle @publication = @publication, @article = @article, @force_invalidate_snapshot = 1; GO