Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 3.24 KB

sp-droppullsubscription-transact-sql.md

File metadata and controls

85 lines (58 loc) · 3.24 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_droppullsubscription (Transact-SQL)
sp_droppullsubscription drops a subscription at the current database of the Subscriber.
markingmyname
maghan
randolphwest
08/22/2024
sql
replication
reference
sp_droppullsubscription
sp_droppullsubscription_TSQL
sp_droppullsubscription
TSQL

sp_droppullsubscription (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Drops a subscription at the current database of the Subscriber. This stored procedure is executed at the Subscriber on the pull subscription database.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_droppullsubscription
    [ @publisher = ] N'publisher'
    [ , [ @publisher_db = ] N'publisher_db' ]
    , [ @publication = ] N'publication'
    [ , [ @reserved = ] reserved ]
    [ , [ @from_backup = ] from_backup ]
[ ; ]

Arguments

[ @publisher = ] N'publisher'

The remote server name. @publisher is sysname, with no default. If all, the subscription is dropped at all the Publishers.

[ @publisher_db = ] N'publisher_db'

The name of the Publisher database. @publisher_db is sysname, with a default of NULL. all means all the Publisher databases.

[ @publication = ] N'publication'

The publication name. @publication is sysname, with no default. If all, the subscription is dropped to all the publications.

[ @reserved = ] reserved

[!INCLUDE ssinternalonly-md]

[ @from_backup = ] from_backup

[!INCLUDE ssinternalonly-md]

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 table and the corresponding Distributor Agent at the Subscriber. If no rows are left in MSreplication_subscriptions, it drops the table.

Examples

:::code language="sql" source="../replication/codesnippet/tsql/sp-droppullsubscription-_1.sql":::

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.

Related content