Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniuNí thacaítear leis an mbrabhsálaí seo a thuilleadh.
Uasghrádú go Microsoft Edge chun leas a bhaint as na gnéithe is déanaí, nuashonruithe slándála, agus tacaíocht theicniúil.
Applies to:
SQL Server
Marks a merge pull subscription for reinitialization the next time the Merge Agent runs. This stored procedure is executed at the Subscriber in the subscription database.
Transact-SQL syntax conventions
sp_reinitmergepullsubscription
[ [ @publisher = ] N'publisher' ]
[ , [ @publisher_db = ] N'publisher_db' ]
[ , [ @publication = ] N'publication' ]
[ , [ @upload_first = ] N'upload_first' ]
[ ; ]
The name of the Publisher. @publisher is sysname, with a default of all
.
The name of the Publisher database. @publisher_db is sysname, with a default of all
.
The name of the publication. @publication is sysname, with a default of all
.
Specifies whether changes at the Subscriber are uploaded before the subscription is reinitialized. @upload_first is nvarchar(5), with a default of false
.
true
, changes are uploaded before the subscription is reinitialized.false
, changes aren't uploaded.0
(success) or 1
(failure).
sp_reinitmergepullsubscription
is used in merge replication.
If you add, drop, or change a parameterized filter, pending changes at the Subscriber can't be uploaded to the Publisher during reinitialization. If you want to upload pending changes, synchronize all subscriptions before changing the filter.
-- 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'AdvWorksSalesOrdersMerge';
USE [AdventureWorks2022Replica]
-- Execute at the Subscriber to reinitialize the pull subscription.
-- Pending changes at the Subscrber are lost.
EXEC sp_reinitmergepullsubscription
@publisher = $(PubServer),
@publisher_db = @publicationDB,
@publication = @publication,
@upload_first = N'false';
GO
-- Start the Merge Agent.
-- 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'AdvWorksSalesOrdersMerge';
USE [AdventureWorks2022Replica]
-- Execute at the Subscriber to reinitialize the pull subscription,
-- and upload pending changes at the Subscriber.
EXEC sp_reinitmergepullsubscription
@publisher = $(PubServer),
@publisher_db = @publicationDB,
@publication = @publication,
@upload_first = N'true';
GO
-- Start the Merge Agent.
Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_reinitmergepullsubscription
.
Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniu