| title | sp_droppullsubscription (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/06/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine | ||
| ms.reviewer | |||
| ms.technology | replication | ||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 7352d94a-f8f2-42ea-aaf1-d08c3b5a0e76 | ||
| author | stevestein | ||
| ms.author | sstein |
[!INCLUDEappliesto-ss-asdbmi-xxxx-xxx-md]
Drops a subscription at the current database of the Subscriber. This stored procedure is executed at the Subscriber on the pull subscription database.
Transact-SQL Syntax Conventions
sp_droppullsubscription [ @publisher= ] 'publisher'
, [ @publisher_db= ] 'publisher_db'
, [ @publication= ] 'publication'
[ , [ @reserved= ] reserved ]
[ @publisher = ] 'publisher'
Is the remote server name. publisher is sysname, with no default. If all, the subscription is dropped at all the Publishers.
[ @publisher_db = ] 'publisher_db'
Is the name of the Publisher database. publisher_db is sysname, with no default. all means all the Publisher databases.
[ @publication = ] 'publication'
Is the publication name. publication is sysname, with no default. If all, the subscription is dropped to all the publications.
[ @reserved = ] reserved
[!INCLUDEssInternalOnly]
0 (success) or 1 (failure)
sp_droppullsubscription is used in snapshot replication and transactional replication.
sp_droppullsubscription deletes the corresponding row in the MSreplication_subscriptions (Transact-SQL) table and the corresponding Distributor Agent at the Subscriber. If no rows are left in MSreplication_subscriptions (Transact-SQL), it drops the table.
[!code-sqlHowTo#sp_droptranpullsubscription]
Only members of the sysadmin fixed server role or the user who created the pull subscription can execute sp_droppullsubscription. The db_owner fixed database role is only able to execute sp_droppullsubscription if the user who created the pull subscription belongs to this role.
Delete a Pull Subscription
sp_addpullsubscription (Transact-SQL)
sp_change_subscription_properties (Transact-SQL)
sp_helppullsubscription (Transact-SQL)
sp_dropsubscription (Transact-SQL)