Aracılığıyla paylaş


sp_addscriptexec (Transact-SQL)

SQL komut dosyası (.sql dosyası) tüm aboneleri için deftere naklettiği bir yayın.Bu saklı yordam, yayın Veritabanı yayımcısına sırasında yürütülür.

Topic link iconTransact-SQL sözdizimi kuralları

sp_addscriptexec [ @publication = ] publication
    [ , [ @scriptfile = ] 'scriptfile' ]
    [ , [ @skiperror = ] 'skiperror' ]
    [ , [ @publisher = ] 'publisher' ]

Bağımsız değişkenler

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

  • [ @scriptfile= ] 'scriptfile'
    Is the full path to the SQL script file.scriptfile is nvarchar(4000), with no default.

  • [ @skiperror= ] 'skiperror'
    Komut dosyası işlenirken bir hata oluşursa bir dağıtım aracısını veya Birleştirme Aracısı durdurmanız gerekir olup olmadığını gösterir.SkipError is bitvarsayılan 0.

    0 = aracı durdurur.

    1 = aracının komut devam eder ve bu hatayı yoksayar.

  • [ @publisher= ] 'publisher'
    Specifies a non-Microsoft SQL Server publisher.publisher is sysname, with a default of NULL.

    Not

    Yayımcı yayımlarken kullanılmamalıdırSQL Server Yayımcı.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (hata)

Remarks

sp_addscriptexec işlem çoğaltma ve birleştirme çoğaltma kullanılır.

sp_addscriptexec anlık görüntü çoğaltması çoğaltması çoğaltma için kullanılır.

Kullanmak için sp_addscriptexec, the SQL Server Hizmet hesabı okuduğunuzdan ve Yazma izinlerini tüm dosyaları konumu anlık görüntü konumu ve Okuma izinlerini depolanır.

The sqlcmd utility is used to yürütmek the script at the abone, and the script is executed in the security context used by the Distribution Agent or Merge Agent when connecting to the abonelik veritabanı.Aracı bir önceki sürümünde çalıştırdığınızda SQL Server, osql yardımcı programının yerine kullanılırsqlCmd.

sp_addscriptexec abonelere komut uygulama kullanışlıdır ve kullanır.sqlCmd komut içeriğini abone için uygulanacak.However, because Subscriber configurations can vary, scripts tested prior to posting to the Publisher may still cause errors on a Subscriber.skiperror provides the ability to have the Distribution Agent or Merge Agent ignore errors and continue on.Kullanımı sqlCmd sınanacak çalıştırmak için önceki komut dosyalarısp_addscriptexec.

Not

Atlanan hatalar için başvuru aracı geçmişinde tutulacak devam edecek.

Using sp_addscriptexec to post a script file for publications using FTP for snapshot delivery is only supported for Microsoft SQL Server Subscribers.

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü veya db_owner sabit veritabanı rolü için yürütmek sp_addscriptexec.