sp_addmergesubscription (Transact-SQL)
gönderme veya çekme birleştirme abonelik oluşturur.Bu saklı yordam, yayın Veritabanı yayımcısına sırasında yürütülür.
sp_addmergesubscription [ @publication= ] 'publication'
[ , [ @subscriber = ] 'subscriber' ]
[ , [ @subscriber_db= ] 'subscriber_db' ]
[ , [ @subscription_type= ] 'subscription_type' ]
[ , [ @subscriber_type= ] 'subscriber_type' ]
[ , [ @subscription_priority= ] subscription_priority ]
[ , [ @sync_type= ] 'sync_type' ]
[ , [ @frequency_type= ] frequency_type ]
[ , [ @frequency_interval= ] frequency_interval ]
[ , [ @frequency_relative_interval= ] frequency_relative_interval ]
[ , [ @frequency_recurrence_factor= ] frequency_recurrence_factor ]
[ , [ @frequency_subday= ] frequency_subday ]
[ , [ @frequency_subday_interval= ] frequency_subday_interval ]
[ , [ @active_start_time_of_day= ] active_start_time_of_day ]
[ , [ @active_end_time_of_day= ] active_end_time_of_day ]
[ , [ @active_start_date= ] active_start_date ]
[ , [ @active_end_date= ] active_end_date ]
[ , [ @optional_command_line= ] 'optional_command_line' ]
[ , [ @description= ] 'description' ]
[ , [ @enabled_for_syncmgr= ] 'enabled_for_syncmgr' ]
[ , [ @offloadagent= ] remote_agent_activation]
[ , [ @offloadserver= ] 'remote_agent_server_name' ]
[ , [ @use_interactive_resolver= ] 'use_interactive_resolver' ]
[ , [ @merge_job_name= ] 'merge_job_name' ]
[ , [ @hostname = ] 'hostname'
Bağımsız değişkenler
[ @publication=] 'publication'
Is the name of the publication.publication is sysname, with no default.yayın varolmalıdır.[ @subscriber =] 'subscriber'
Is the name of the Subscriber.subscriber is sysname, with a default of NULL.[ @subscriber_db=] 'subscriber_db'
Is the name of the subscription database.subscriber_dbis sysname, with a default of NULL.[ @subscription_type=] 'subscription_type'
Is the type of subscription.subscription_typeis nvarchar(15), with a default of PUSH.If push, bir gönderme temelli abonelik eklenir ve Birleştirme Aracısı dağıtımcı eklenir. If pull, çekme temelli abonelik sırasında dağıtımcı bir Birleştirme Aracısı eklemeden eklenir.Not
Anonim abonelikler Bu saklı yordam kullanmak gerekmez.
[ @subscriber_type=] 'subscriber_type'
Is the type of Subscriber.subscriber_typeis nvarchar(15), and can be one of the following values.Değer
Açıklama
local (varsayılan)
Yalnızca yayımcıya bilinen abone.
global
Tüm sunucular için bilinen abone.
Içinde SQL Server 2005 ve sonraki sürümlerde, yerel abonelikler istemci abonelikler adlandırılır ve genel abonelikler sunucu abonelikler anılır. Daha fazla bilgi için "Abonelik türleri" bölümüne bakın... Birleştirme çoğaltması nasıl algılıyor ve çakışmaları çözümler..
[ @subscription_priority=] subscription_priority
Is a number indicating the priority for the subscription.subscription_priorityis real, with a default of NULL.Yerel ve anonim abonelikler önceliği 0.0 ' dir.Genel abonelikler için öncelik 100.0'den az olmalıdır.[ @sync_type=] 'sync_type'
Is the subscription synchronization type.sync_typeis nvarchar(15), with a default of automatic.Olabilir automatic veya none. If automatic, yayımlanmış olan tablolar için ilk veri ve şema abone için öncelikle transfer edilir. If none, yayımlanmış olan tablolar için ilk veri ve şema zaten abone olan varsayılır. sistem tabloları ve verileri her zaman transfer edilir.Not
Bir değeri olmayan belirtme önerilir none. Daha fazla bilgi için bkz: Bir birleştirme aboneliği olmayan bir anlık görüntü başlatılıyor.
[ @frequency_type=] frequency_type
Is a value indicating when the Merge Agent will run.frequency_type is int, and can be one of the following values.Değer
Açıklama
1
Bir kez
4
Günlük
8
Haftalık
10
Aylık
20
Aylık bağlantılıdır, frekans aralığı
40
Ne zaman SQL Server Aracı'nı başlatır
NULL(default)
[ @frequency_interval=] frequency_interval
The day or days that the Merge Agent runs.frequency_interval is int, and can be one of the following values.Değer
Açıklama
1
Pazar
2
Pazartesi
3
Salı
4
Çarşamba
5
Perşembe
6
Cuma
7
Cumartesi
8
Günü
9
Haftanın günleri
10
Hafta sonu günler
NULL(default)
[ @frequency_relative_interval=] frequency_relative_interval
Is the scheduled merge occurrence of the frequency interval in each month.frequency_relative_interval is int, and can be one of these values.Değer
Açıklama
1
First
2
Ikinci
4
Üçüncü
8
Dördüncü
16
Last
NULL(default)
[ @frequency_recurrence_factor=] frequency_recurrence_factor
Is the recurrence factor used by frequency_type.frequency_recurrence_factoris int, with a default of NULL.[ @frequency_subday=] frequency_subday
Is the unit for frequency_subday_interval.frequency_subday is int, and can be one of the following values.Değer
Açıklama
1
Bir kez
2
Ikinci
4
Dakika
8
Saat
NULL(default)
[ @frequency_subday_interval=] frequency_subday_interval
Is the frequency for frequency_subday to occur between each merge.frequency_subday_interval is int, with a default of NULL.[ @active_start_time_of_day=] active_start_time_of_day
Is the time of day when the Merge Agent is first scheduled, formatted as HHMMSS.active_start_time_of_day is int, with a default of NULL.[ @active_end_time_of_day=] active_end_time_of_day
Is the time of day when the Merge Agent stops being scheduled, formatted as HHMMSS.active_end_time_of_day is int, with a default of NULL.[ @active_start_date=] active_start_date
Is the date when the Merge Agent is first scheduled, formatted as YYYYMMDD.active_start_date is int, with a default of NULL.[ @active_end_date=] active_end_date
Is the date when the Merge Agent stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of NULL.[ @optional_command_line=] 'optional_command_line'
Is the optional command prompt to execute.optional_command_lineis nvarchar(4000), with a default of NULL.Bu parametre, çıktı yakalar ve onu bir dosyaya kaydeder bir komut eklemek için veya bir yapılandırma dosyası veya öznitelik belirtmek için kullanılır.[ @description=] 'description'
Is a brief description of this merge subscription.descriptionis nvarchar(255), with a default of NULL.Bu değer tarafından çoğaltma izleyicisi'nde görüntülenen Kolay ad sütun izlenen yayın abonelikler sıralamak için kullanılabilir.[ @enabled_for_syncmgr=] 'enabled_for_syncmgr'
Specifies if the subscription can be synchronized through Microsoft Windows Synchronization Manager.enabled_for_syncmgr is nvarchar(5), with a default of FALSE.If false, Eşitleme Yöneticisi ile abonelik kayıtlı değil. If true, the subscription is registered with Synchronization Manager and can be synchronized without starting Microsoft SQL Server Management Studio.[ @offloadagent= ] remote_agent_activation
Specifies that the agent can be activated remotely.remote_agent_activation is bit with a default of 0.Not
Bu parametre, onaylanmaz ve yalnızca geriye dönük uyumluluk komut dosyaları için korunur.
[ @offloadserver= ] 'remote_agent_server_name'
Specifies the network name of server to be used for remote agent activation.remote_agent_server_nameis sysname, with a default of NULL.[ @use_interactive_resolver= ] 'use_interactive_resolver'
Allows conflicts to be resolved interactively for all articles that allow interactive resolution.use_interactive_resolver is nvarchar(5), with a default of FALSE.[ @merge_job_name= ] 'merge_job_name'
Name of the Merge Agent job that is added for this subscription.merge_job_name is sysname, with a default of NULL.Bu parametre, böylece daha sonra bu işlemi yönetilebilir sağlanacak Birleştirme Aracısı iş adı sağlar.[ @ anabilgisayaradı= ] 'hostname'
Overrides the value returned by HOST_NAME when this function is used in the WHERE clause of a parameterized filter.Hostname is sysname, with a default of NULL.Important Note: Performansı düşürmemek için işlevler için süzgeç yan tümceleri parametreli satır, sütun adları gibi uyguladığınız değil önerilir LEFT([MyColumn]) = SUSER_SNAME(). Kullanıyorsanız host_name Filtre yan tümce ve geçersiz kılma değeri HOST_NAME kullanarak veri türlerini dönüştürmek gerekli olabilirDÖNÜŞTÜRME.Bu servis talebiyle ilgili en iyi yöntemler hakkında daha fazla bilgi için konunun "HOST_NAME() değeri geçersiz kılma" bölümüne bakın... Parametreli satır süzgeçleri.
Dönüş Kodu Değerleri
0 (başarılı) veya 1 (hata)
Remarks
sp_addmergesubscription birleştirme çoğaltmasında kullanılır.
Ne zaman sp_addmergesubscription bir üyesi tarafından çalıştırılırsysadmin Birleştirme Aracısı iş örtülü olarak oluşturulur ve çalışan altında sabit sunucu rolü'bir gönderme temelli abonelik oluşturmak içinSQL Server Aracı hizmet hesabı. Öneririz, yürütmek sp_addmergepushsubscription_agent için farklı, özel Aracısı bir Windows hesabı kimlik bilgileri bilgilerini belirtin.@ job_login and @ job_password.Daha fazla bilgi için bkz: Çoğaltma aracısı güvenlik modeli.
İzinler
Yalnızca üyeleri sysadmin sabit sunucu rolü veya db_owner sabit veritabanı rolü için yürütmek sp_addmergesubscription.
See Also