Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 3.61 KB

File metadata and controls

70 lines (53 loc) · 3.61 KB
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
sp_droppullsubscription
sp_droppullsubscription_TSQL
helpviewer_keywords
sp_droppullsubscription
ms.assetid 7352d94a-f8f2-42ea-aaf1-d08c3b5a0e76
author stevestein
ms.author sstein

sp_droppullsubscription (Transact-SQL)

[!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.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_droppullsubscription [ @publisher= ] 'publisher'  
        , [ @publisher_db= ] 'publisher_db'  
        , [ @publication= ] 'publication'  
    [ , [ @reserved= ] reserved ]  

Arguments

[ @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]

Return Code Values

0 (success) or 1 (failure)

Remarks

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.

Example

[!code-sqlHowTo#sp_droptranpullsubscription]

Permissions

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.

See Also

Delete a Pull Subscription
sp_addpullsubscription (Transact-SQL)
sp_change_subscription_properties (Transact-SQL)
sp_helppullsubscription (Transact-SQL)
sp_dropsubscription (Transact-SQL)