sp_register_custom_scripting (języka Transact-SQL)

Replikacja umożliwia użytkownika niestandardowych procedur przechowywanych zastąpienie jednego lub więcej procedur domyślne używane w replikacja transakcyjna.When a schema change is made to a replicated table, these stored procedures are re-created.sp_register_custom_scripting registers a stored procedure or Transact-SQL script file that is executed when a schema change occurs to script out the definition for a new user-defined custom stored procedure.This new user-defined custom stored procedure should reflect the new schema for the table.sp_register_custom_scripting is executed at the Publisher on the publication database, and the registered script file or stored procedure is executed at the Subscriber when a schema change occurs.

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

Składnia

sp_register_custom_scripting [ @type  = ] 'type'
    [ @value = ] 'value' 
    [ , [ @publication = ] 'publication' ]
    [ , [ @article = ] 'article' ]

Argumenty

  • [ @type = ] 'type'
    Is the type of custom stored procedure or script being registered.type is varchar(16), with no default, and can be one of the following values.

    Wartość

    Opis

    Wstaw

    Zarejestrowane niestandardowe procedura składowana jest wykonywane po instrukcja INSERT jest replikowana.

    Aktualizacja

    Zarejestrowane niestandardowe procedura składowana jest wykonywane po instrukcja UPDATE jest replikowana.

    Usuń

    Zarejestrowane niestandardowe procedura składowana jest wykonywane po Instrukcja DELETE jest replikowana.

    custom_script

    Skrypt jest wykonywany na końcu wyzwalacza (DDL) języka definicja danych.

  • [ wartość @=] 'value"
    Name of a stored procedure or name and fully-qualified path to the Transact-SQL script file that is being registered.value is nvarchar(1024), with no default.

    Ostrzeżenie

    Specifying NULL for valueparameter will unregister a previously registered script, which is the same as running sp_unregister_custom_scripting.

    Gdy wartość type jest custom_script, nazwę i pełną ścieżka Transact-SQL Oczekiwano pliku skryptu.W przeciwnym razie value musi być nazwą zarejestrowanych procedura składowana.

  • [ publikacja @=] 'publication"
    Name of the publication for which the custom stored procedure or script is being registered.publication is sysname, with a default of NULL.

  • [ Artykuł @ =] 'article"
    Name of the article for which the custom stored procedure or script is being registered.article is sysname, with a default of NULL.

Wartości kodów powrotnych

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

Uwagi

sp_register_custom_scripting używane w migawce i replikacja transakcyjna.

Tej procedura składowana powinna być wykonywana przed dzięki zreplikowanej tabela zmienić schemat.Aby uzyskać więcej informacji na temat korzystania z tej procedura składowana, zobacz Ponowne generowanie niestandardowych transakcyjnych procedury, aby odzwierciedlić zmiany schematu.

Uprawnienia

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