gebeurtenis
31 mrt, 23 - 2 apr, 23
De grootste SQL-, Fabric- en Power BI-leerevenement. 31 maart – 2 april. Gebruik code FABINSIDER om $ 400 te besparen.
Zorg dat u zich vandaag nog registreertDeze browser wordt niet meer ondersteund.
Upgrade naar Microsoft Edge om te profiteren van de nieuwste functies, beveiligingsupdates en technische ondersteuning.
Applies to:
SQL Server
Azure SQL Managed Instance
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 = ] 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.
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
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.
-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables
-- on the command line and in SQL Server Management Studio, see the
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".
-- This is the batch executed at the Subscriber to drop
-- a pull subscription to a transactional publication.
DECLARE @publication AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB AS sysname;
SET @publication = N'AdvWorksProductTran';
SET @publisher = $(PubServer);
SET @publicationDB = N'AdventureWorks2022';
USE [AdventureWorks2022Replica]
EXEC sp_droppullsubscription
@publisher = @publisher,
@publisher_db = @publicationDB,
@publication = @publication;
GO
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.
gebeurtenis
31 mrt, 23 - 2 apr, 23
De grootste SQL-, Fabric- en Power BI-leerevenement. 31 maart – 2 april. Gebruik code FABINSIDER om $ 400 te besparen.
Zorg dat u zich vandaag nog registreert