Transact-SQL Reference

sp_dropsubscription

Drops subscriptions to a particular article, publication, or set of subscriptions on the Publisher. This stored procedure is executed at the Publisher on the publication database.

Syntax

sp_dropsubscription [ [ @publication = ] 'publication' ]
    [ , [ @article = ] 'article' ]
    [ @subscriber = ] 'subscriber'
    [ , [ @destination_db = ] 'destination_db' ]
    [ , [ @ignore_distributor = ] ignore_distributor ]
    [ , [ @reserved = ] 'reserved' ]

Arguments

[@publication = ] 'publication'

Is the name of the associated publication. publication is sysname, with a default of NULL. If all, all subscriptions for all publications for the specified Subscriber are canceled.

[@article = ] 'article'

Is the name of the article. article is sysname, with a default of NULL. If all, subscriptions to all articles for each specified publication and Subscriber are dropped. If article is not supplied, subscriptions are dropped for all articles in the publication. Use all for immediate-sync publications.

[@subscriber = ] 'subscriber'

Is the name of the Subscriber that will have its subscriptions dropped. subscriber is sysname, with no default. If all, all subscriptions for all Subscribers are dropped.

[@destination_db = ] 'destination_db'

Is the name of the destination database. destination_db is sysname, with a default of NULL. If NULL, all the subscriptions from that Subscriber are dropped.

[@ignore_distributor = ] ignore_distributor

For internal use only.

[@reserved = ] 'reserved'

For internal use only.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_dropsubscription is used in snapshot and transactional replication.

If you drop the subscription on an article in an immediate-sync publication, you cannot add it back unless you drop the subscriptions on all the articles in the publication and add them all back at once.

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_dropsubscription. A remote connection from the Subscriber can drop a subscription to an existing publication or article.

See Also

sp_addsubscription

sp_changesubstatus

sp_helpsubscription

System Stored Procedures