sp_dropsubscription (T-SQL)

Drops subscriptions to a particular article, publication, or set of subscriptions on the Publisher.

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'
Is reserved for internal use only. reserved is nvarchar(10).
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_helpsubscription
sp_changesubstatus System Stored Procedures

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.