sp_addmergesubscription (Transact-SQL)

Tworzy wypychania lub ściągać scalić subskrypcja.Ta procedura przechowywana jest wykonywana przez wydawcę na baza danych publikacja.

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

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'

Argumenty

  • [ @publication=] 'publication'
    Is the name of the publication.publication is sysname, with no default.Publikacja musi już istnieć.

  • [ @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.Jeśli push, subskrypcja wypychana zostanie dodany, a następnie scal Agent jest dodawane u dystrybutor. Jeśli pull, subskrypcja ściąganej zostanie dodany bez dodawania Agent Scal u dystrybutor.

    Uwaga

    Subskrypcje anonimowy nie ma potrzeby za pomocą tej procedura przechowywana.

  • [ @subscriber_type=] 'subscriber_type'
    Is the type of Subscriber.subscriber_typeis nvarchar(15), and can be one of the following values.

    Wartość

    Description

    local (domyślnie)

    Subskrybent znany tylko Wydawca.

    global

    Subskrybent wiadomo, że wszystkie serwery.

    W SQL Server 2005 i nowszych wersji lokalnych subskrypcje są określane jako subskrypcji klient i subskrypcje globalne są określane jako serwer subskrypcji. Aby uzyskać więcej informacji zobacz sekcję "Typy subskrypcja" w Jak replikacja łączenia wykrywa i usuwa konflikty.

  • [ @subscription_priority=] subscription_priority
    Is a number indicating the priority for the subscription.subscription_priorityis real, with a default of NULL.Lokalne i anonimowe subskrypcji priorytet to 0. 0.Globalne subskrypcji priorytet musi być mniejsza niż 100.0.

  • [ @sync_type=] 'sync_type'
    Is the subscription synchronization type.sync_typeis nvarchar(15), with a default of automatic.Może być automatic lub none. Jeśli automatic, schematu i początkowych danych opublikowanych tabel są przenoszone do subskrybent najpierw. Jeśli none, zakłada się, subskrybent ma już schematu i początkowych danych opublikowanych tabel. Tabele systemowe i danych zawsze są przenoszone.

    Uwaga

    Firma Microsoft zaleca, aby nie określając wartość none. Aby uzyskać więcej informacji zobacz Inicjowanie subskrypcja korespondencji seryjnej bez migawka.

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

    Wartość

    Description

    1

    Tylko raz

    4

    Dzienne

    8

    Co tydzień

    10

    Miesięczne

    20

    Co miesiąc względem interwał częstotliwości

    40

    Kiedy SQL Server Agent jest uruchamiany

    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.

    Wartość

    Description

    1

    Niedziela

    2

    Poniedziałek

    3

    Wtorek

    4

    Środa

    5

    Czwartek

    6

    Piątek

    7

    Sobota

    8

    Dzień

    9

    Dni tygodnia

    10

    Dni weekendowe

    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.

    Wartość

    Description

    1

    First

    2

    Sekundy

    4

    Trzecia

    8

    Czwarty

    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.

    Wartość

    Description

    1

    Tylko raz

    2

    Sekundy

    4

    Minuta

    8

    Godziny

    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.Ten parametr jest używany, aby dodać polecenia, który przechwytuje dane wyjściowe i zapisuje go w pliku lub, aby określić plik konfiguracji lub atrybut.

  • [ @description=] 'description'
    Is a brief description of this merge subscription.descriptionis nvarchar(255), with a default of NULL.Ta wartość jest wyświetlana przez Monitor replikacja w Przyjazna nazwa kolumna, które mogą być używane do sortowania subskrypcji dla monitorowanej publikacja.

  • [ @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.Jeśli false, subskrypcja nie został zarejestrowany z menedżer synchronizacji. 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.

    Uwaga

    Tego parametru została zastąpiona i jest obsługiwana tylko w celu zapewnienia zgodności z poprzednimi wersjami skryptów.

  • [ @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.Ten parametr umożliwia nazwę zadania agenta korespondencji seryjnej mają być dostarczane tak, aby to zadanie, które mogą być administrowane później.

  • [ @ nazwy hosta= ] "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 noteImportant Note:

    Ze względu na wydajność zaleca się nie zastosowanie funkcji nazw kolumn w sparametryzowana wiersz filtru klauzule, takie jak LEFT([MyColumn]) = SUSER_SNAME(). Jeśli używasz HOST_NAME w klauzula filtru i zastępowania wartości HOST_NAME, może się okazać konieczne do konwersji typów danych za pomocą KONWERTOWANIE.Aby uzyskać więcej informacji o najważniejszych wskazówkach dotyczących tej przypadek zobacz sekcję "Zastępowanie HOST_NAME() wartość" w temacie Sparametryzowana filtry wierszy.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

sp_addmergesubscription jest używane w korespondencji seryjnej replikacja.

Kiedy sp_addmergesubscription jest wykonywany przez element członkowski członkowski sysadmin stała rola serwera do utworzenia subskrypcja wypychana, tworzona jest niejawnie zadanie agenta korespondencji seryjnej i działa w ramach SQL Server Konto usługa agenta. Zaleca się, że wykonać sp_addmergepushsubscription_agent i określ poświadczenia konta systemu Windows inny, specyficzny dla agenta dla @ job_login and @ job_password.Aby uzyskać więcej informacji zobacz Replication Agent Security Model.

Uprawnienia

Tylko członkowie sysadmin Rola serwera lub db_owner stała rola bazy danych może wykonać sp_addmergesubscription.