sp_reinitmergepullsubscription (języka Transact-SQL)

Znaczniki scalania Pobierz subskrypcję dla ponownego zainicjowania następnego czas Agent korespondencji seryjnej jest uruchamiany.Ta procedura składowana jest wykonywany przez subskrybenta w baza danych subskrypcja.

Ikona łącza do tematuKonwencje składni Transact-SQL

Składnia

sp_reinitmergepullsubscription [ [ @publisher = ] 'publisher' ]
    [ , [ @publisher_db = ] 'publisher_db' ]
    [ , [ @publication = ] 'publication' ]
    [ , [ @upload_first = ] 'upload_first'

Argumenty

  • [ program publisher @ =] 'publisher"
    Is the name of the Publisher.publisher is sysname, with a default of ALL.

  • [ @ publisher_db =] 'publisher_db"
    Is the name of the Publisher database.publisher_db is sysname, with a default of ALL.

  • [ publikacja @=] 'publication"
    Is the name of the publication.publication is sysname, with a default of ALL.

  • [ @ upload_first =] 'upload_first"
    Is whether changes at the Subscriber are uploaded before the subscription is reinitialized.upload_first is nvarchar(5), with a default of FALSE.Jeśli true, zmiany są przekazywane przed ustawienie ponownie inicjowane subskrypcja.Jeśli false, zmiany nie są przekazywane.

Wartości kodów powrotnych

0 (sukces) lub 1 (błąd)

Uwagi

sp_reinitmergepullsubscription używane w replikacja scalająca.

Jeśli dodawanie, drop lub zmienić filtr sparametryzowana oczekujące zmiany subskrybent nie można przekazać do Wydawca podczas ponownego inicjowania.Jeśli chcesz przekazać oczekujące zmiany, należy zsynchronizować wszystkie subskrypcje przed zmianą filtru.

Przykład

-- 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'AdventureWorks2008R2';
SET @publication = N'AdvWorksSalesOrdersMerge';

USE [AdventureWorks2008R2Replica]

-- 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'AdventureWorks2008R2';
SET @publication = N'AdvWorksSalesOrdersMerge';

USE [AdventureWorks2008R2Replica]

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

Uprawnienia

Tylko członkowie sysadmin stała rola serwera lub db_owner ustaloną rola bazy danych można wykonać sp_reinitmergepullsubscription.