sp_reinitpullsubscription (języka Transact-SQL)

Oznacza transakcyjnych ściągania lub subskrypcja anonimowa dla następnego ponownego zainicjowania czas działa Agent dystrybucji.Ta procedura składowana jest wykonywany przez subskrybenta ściągania baza danych subskrypcji.

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

Składnia

sp_reinitpullsubscription [ @publisher = ] 'publisher'
        , [ @publisher_db = ] 'publisher_db'
        , [ @publication = ] 'publication'

Argumenty

  • [ @ publisher = 'wydawcy"
    Is the name of the Publisher.publisher is sysname, with no default.

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

  • [ @ publikacja = 'publikacja"
    Is the name of the publication.publication is sysname, with a default of all, which marks all subscriptions for reinitialization.

Wartości kodów powrotnych

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

Uwagi

sp_reinitpullsubscription w replikacja transakcyjna.

sp_reinitpullsubscription nie jest obsługiwana dla typu peer-to-peer replikacja transakcyjna.

sp_reinitpullsubskrypcja może być wywołana z abonenta, aby ponownie zainicjować subskrypcja, podczas następnego uruchomienia agenta dystrybucji.

Subskrypcje na publikacje utworzone z wartością false dla @ immediate_sync nie należy ponownie zainicjować od subskrybenta.

Można ponownie zainicjować subskrypcja wciągana albo wykonując sp_reinitpullsubscription przez subskrybenta lub sp_reinitsubscription przez wydawcę.

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'AdvWorksProductTran';

USE [AdventureWorks2008R2Replica]

-- Execute at the Subscriber to reinitialize the pull subscription. 
EXEC sp_reinitpullsubscription 
    @publisher = $(PubServer),
    @publisher_db = @publicationDB,
    @publication = @publication;
GO

-- Start the Distribution Agent.

Uprawnienia

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