Aracılığıyla paylaş


sp_register_custom_scripting (Transact-SQL)

Çoğaltma, biri yordamlardan birini veya birkaçını işlemsel kopyalamada kullanılan varsayılan değiştirmek kullanıcı tanımlı özel saklı yordamlarda sağlar.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.

Konu bağlantısı simgesiTransact-sql sözdizimi kuralları

Sözdizimi

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

Bağımsız değişkenler

  • [ @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.

    Değer

    Açıklama

    Ekle

    INSERT deyim çoğaltıldığında kayıtlı özel saklı yordam yürütülür.

    Güncelleştirme

    Bir update deyim çoğaltıldığında kayıtlı özel saklı yordam yürütülür.

    Sil

    delete deyim çoğaltıldığında kayıtlı özel saklı yordam yürütülür.

    custom_script

    Komut dosyası, sonunda yürütüldüğünde veri tanımlama dili (ddl) tetikleyici.

  • [ @ değeri=] '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.

    Not

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

    Zaman değeri type olan custom_script, adı ve tam yol , bir Transact-SQL komut dosyası bekler.Aksi takdirde, value kayıtlı bir adı olması gerekir saklı yordam.

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

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

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (başarısız)

Açıklamalar

sp_register_custom_scripting anlık görüntü ve işlem çoğaltma kullanılır.

Bu saklı yordam değiştirmek için çoğaltılmış bir tablo şema kılmadan önce yürütülmelidir.Bu saklı yordam kullanma hakkında daha fazla bilgi için bkz: Özel şema değişiklikleri yansıtmak için işlemsel yordamları yeniden oluşturuluyor.

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü db_owner sabit veritabanı rolü veya db_ddladmin sabit veritabanı rolü olabilir yürütmek sp_register_custom_scripting.