sp_droppublication Replication Stored Procedure

Drops a publication and its associated articles.

Syntax

sp_droppublication publication

where

publication
Is the name of the publication to be dropped. If all is specified, all publications are dropped from the publication database, except for those with subscriptions.

Remarks

This stored procedure 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 will also be dropped. Only the system administrator or the database owner can drop a publication.

Example

This example drops the mypub3 publication.

sp_droppublication mypub3

Permission

Execute permission defaults to the system administrator and the database owner.

Tables Used

sysarticles, syspublications, syssubscriptions

See Also

sp_addarticle sp_droparticle
sp_addpublication sp_enumfullsubscribers
sp_articlecolumn sp_helparticle
sp_changearticle sp_helparticlecolumns
sp_changepublication sp_helppublication