sp_addsynctriggers (języka Transact-SQL)

Tworzy wyzwalaczy przez subskrybenta z wszystkich typów subskrypcje aktualizowalny (natychmiastowe, kolejkowane i natychmiastowej aktualizacji z aktualizacją w kolejce jako praca awaryjna).Ta procedura składowana jest wykonywany przez subskrybenta na baza danych subskrypcja.

Ważna informacjaWażne:

The sp_script_synctran_commands procedure should be used instead of sp_addsynctrigger.sp_script_synctran_commands generates a script that contains the sp_addsynctrigger calls.

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

Składnia

sp_addsynctriggers [ @sub_table = ] 'sub_table'
        , [ @sub_table_owner = ] 'sub_table_owner'
        , [ @publisher = ] 'publisher'
        , [ @publisher_db = ] 'publisher_db'
        , [ @publication = ] 'publication' 
        , [ @ins_proc = ] 'ins_proc' 
        , [ @upd_proc = ] 'upd_proc' 
        , [ @del_proc = ] 'del_proc' 
        , [ @cftproc = ] 'cftproc'
        , [ @proc_owner = ] 'proc_owner'
    [ , [ @identity_col = ] 'identity_col' ]
    [ , [ @ts_col = ] 'timestamp_col' ]
    [ , [ @filter_clause = ] 'filter_clause' ] 
        , [ @primary_key_bitmap = ] 'primary_key_bitmap'
    [ , [ @identity_support = ] identity_support ]
    [ , [ @independent_agent = ] independent_agent ]
        , [ @distributor = ] 'distributor' 
    [ , [ @pubversion = ] pubversion

Argumenty

  • [ @ sub_table = 'sub_table"
    Is the name of the Subscriber table.sub_table is sysname, with no default.

  • [ @ sub_table_owner = 'sub_table_owner"
    Is the name of the owner of the Subscriber table.sub_table_owner is sysname, with no default.

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

  • [ @ publisher_db = 'publisher_db"
    Is the name of the Publisher database.publisher_db is sysname, with no default.Jeśli wartość NULL, używana jest bieżąca baza danych.

  • [ @ publikacja = 'publication"
    Is the name of the publication.Publication is sysname, with no default.

  • [ @ ins_proc = 'ins_proc"
    Is the name of the stored procedure that supports synchronous transaction inserts at the Publisher.ins_proc is sysname, with no default.

  • [ @ upd_proc = 'upd_proc"
    Is the name of the stored procedure that supports synchronous transaction updates at the Publisher.ins_proc is sysname, with no default.

  • [ @ del_proc = 'del_proc"
    Is the name of the stored procedure that supports synchronous transaction deletes at the Publisher.ins_proc is sysname, with no default.

  • [ @ cftproc = 'cftproc"
    Is the name of the auto-generated procedure used by publications that allow queued updating.cftproc is sysname, with no default.Dla publikacji, które umożliwiają natychmiastowe aktualizowanie ta wartość jest NULL.Ten parametr ma zastosowanie do publikacji, które umożliwiają aktualizowanie kolejce (w kolejce aktualizowanie i natychmiastowej aktualizacji z aktualizacją w kolejce jako praca awaryjna).

  • [ @ proc_owner = 'proc_owner"
    Specifies the user account in the Publisher under which all the auto-generated stored procedures for updating publication (queued and/or immediate) were created.proc_owner is sysname with no default.

  • [ @ identity_col = 'identity_col"
    Is the name of the identity column at the Publisher.identity_col is sysname, with a default of NULL.

  • [ @ ts_col = 'timestamp_col"
    Is the name of the timestamp column at the Publisher.timestamp_col is sysname, with a default of NULL.

  • [ @ filter_clause = 'filter_clause"
    Ograniczenie jest klauzula (gdzie) definiujący poziome filtru.When entering the restriction clause, omit the keyword WHERE.filter_clauseis nvarchar(4000), with a default of NULL.

  • [ @ primary_key_bitmap = 'primary_key_bitmap"
    Is a bit map of the primary key columns in the table.primary_key_bitmap is varbinary(4000), with no default.

  • [ @ identity_support = identity_support
    Enables and disables automatic identity range handling when queued updating is used.identity_support is a bit, with a default of 0.0 oznacza brak nie tożsamości w zakresie pomocy technicznej, 1 umożliwia automatyczne tożsamości zakres obsługi.

  • [ @ independent_agent = independent_agent
    Wskazuje, czy istnieje jeden pełnomocnik dystrybucji (niezależny agent) dla tej publikacja lub jednego agenta dystrybucji na publikacja w bazie danych i baza danych subskrypcja para (agent udostępnionego).This value reflects the value of the independent_agent property of the publication defined at the Publisher.independent_agent is a bit with a default of 0.Jeśli 0, agent jest Agent udostępnione.Jeśli 1, agent jest niezależny agent.

  • [ @ dystrybutor = 'distributor"
    Is the name of the Distributor.distributor is sysname, with no default.

  • [ @ pubversion=] pubversion
    Indicates the version of the Publisher.pubversion is int, with a default of 1.1 means that the Publisher version is Microsoft SQL Server 2000 Service Pack 2 or earlier; 2 means that the Publisher is SQL Server 2000 Service Pack 3 (SP3) or later.pubversion must be explicitly set to 2 when the Publisher version is SQL Server 2000 SP3 or later.

Wartości kodów powrotnych

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

Uwagi

sp_addsynctriggers jest używana przez agenta dystrybucji jako część inicjowania subskrypcja.Ta procedura składowana nie jest często uruchamiane przez użytkowników, ale może być przydatne, jeśli użytkownik chce zestaw up subskrypcja synchronizacji nie ręcznie.

Uprawnienia

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