| title | sp_droppullsubscription (Transact-SQL) | ||
|---|---|---|---|
| description | sp_droppullsubscription drops a subscription at the current database of the Subscriber. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | replication | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!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
sp_droppullsubscription
[ @publisher = ] N'publisher'
[ , [ @publisher_db = ] N'publisher_db' ]
, [ @publication = ] N'publication'
[ , [ @reserved = ] reserved ]
[ , [ @from_backup = ] from_backup ]
[ ; ]
The remote server name. @publisher is sysname, with no default. If all, the subscription is dropped at all the Publishers.
The name of the Publisher database. @publisher_db is sysname, with a default of NULL. all means all the Publisher databases.
The publication name. @publication is sysname, with no default. If all, the subscription is dropped to all the publications.
[!INCLUDE ssinternalonly-md]
[!INCLUDE ssinternalonly-md]
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 table and the corresponding Distributor Agent at the Subscriber. If no rows are left in MSreplication_subscriptions, it drops the table.
:::code language="sql" source="../replication/codesnippet/tsql/sp-droppullsubscription-_1.sql":::
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.