Udostępnij za pośrednictwem


sp_addsynctriggers (Transact-SQL)

Tworzy wyzwalacze przez subskrybent z wszystkich typów można aktualizować subskrypcji (natychmiastowe, kolejkowane i bezpośrednim uaktualnianiu z aktualizacji w kolejce jako praca awaryjna).Ta procedura przechowywana jest wykonywany przez subskrybent do baza danych subskrypcja.

Important noteImportant Note:

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.

Topic link iconKonwencje składni języka Transact-SQL

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ścią tą jest NULL, używana jest bieżąca baza danych.

  • [ @publication=] '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 aktualizacji i bezpośrednim uaktualnianiu z aktualizacji 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 (WHERE), definiująca 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, że brak obsługi zakresu tożsamości, 1 włącza obsługę zakres automatyczne tożsamości.

  • [ @independent_agent = ] independent_agent
    Wskazuje, czy istnieje jeden agent dystrybucji (niezależnych agenta) dla tej publikacja lub jeden agent dystrybucji na publikacja bazy danych i subskrypcja bazy danych pary (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ępnionych w sieci.Jeśli 1, agent jest agenta niezależnych.

  • [ @distributor = ] '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 (brak)

Remarks

sp_addsynctriggers jest używana przez agenta dystrybucji jako część inicjowania subskrypcja.Ta procedura przechowywana jest często wykonywane przez użytkowników, ale może być przydatne, jeśli użytkownik chce skonfigurować subskrypcja synchronizacji nie ręcznie.

Uprawnienia

Tylko członkowie sysadmin Rola serwera lub db_owner stała rola bazy danych może być wykonywany sp_addsynctriggers.