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
Marks a transactional pull or anonymous subscription for reinitialization the next time the Distribution Agent runs. This stored procedure is executed at the Subscriber on the pull subscription database.
Transact-SQL syntax conventions
sp_reinitpullsubscription
[ @publisher = ] N'publisher'
[ , [ @publisher_db = ] N'publisher_db' ]
[ , [ @publication = ] N'publication' ]
[ ; ]
The name of the Publisher. @publisher is sysname, with no default.
The name of the Publisher database. @publisher_db is sysname, with a default of NULL
.
The name of the publication. @publication is sysname, with a default of all
, which marks all subscriptions for reinitialization.
0
(success) or 1
(failure).
sp_reinitpullsubscription
is used in transactional replication.
sp_reinitpullsubscription
isn't supported for peer-to-peer transactional replication.
sp_reinitpullsubscription
can be called from the Subscriber to reinitialize the subscription, during the next run of the Distribution Agent.
Subscriptions to publications created with a value of false
for @immediate_sync can't be reinitialized from the Subscriber.
You can reinitialize a pull subscription by either executing sp_reinitpullsubscription
at the Subscriber or sp_reinitsubscription
at the Publisher.
-- 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".
DECLARE @publicationDB AS sysname;
DECLARE @publication AS sysname;
SET @publicationDB = N'AdventureWorks2022';
SET @publication = N'AdvWorksProductTran';
USE [AdventureWorks2022Replica]
-- Execute at the Subscriber to reinitialize the pull subscription.
EXEC sp_reinitpullsubscription
@publisher = $(PubServer),
@publisher_db = @publicationDB,
@publication = @publication;
GO
-- Start the Distribution Agent.
Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_reinitpullsubscription
.
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