Drops a publication and its associated articles. This stored procedure is executed at the Publisher on the publication database.
sp_droppublication [ @publication = ] 'publication'
[ , [ @ignore_distributor = ] ignore_distributor ]
[@publication = ] 'publication'
Is the name of the publication to be dropped. publication is sysname, with no default. If all is specified, all publications are dropped from the publication database, except for those with subscriptions.
[@ignore_distributor = ] ignore_distributor
For internal use only.
Return Code Values
0 (success) or 1 (failure)
sp_droppublication is used in snapshot replication and transactional replication.
sp_droppublication recursively drops all articles associated with a publication and then drops the publication itself. A publication cannot be removed if it has one or more subscriptions to it. The associated sync task is also dropped.
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_droppublication.