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