sp_addpushsubscription_agent (Transact-SQL)

Dodaje nowe zadanie zaplanowane agenta, używane do synchronizacji subskrypcja wypychana do publikacja transakcyjnych.Ta procedura przechowywana jest wykonywana przez wydawcę na baza danych publikacja.

Security noteSecurity Note:

Podczas konfigurowania przez wydawcę z dystrybutor zdalny wartości dostarczane dla wszystkich parametrów w tym job_login i job_password, są wysyłane do dystrybutor jako zwykły tekst. Należy zaszyfrować połączenie między Wydawca i jego dystrybutor zdalnym przed wykonaniem tej procedura przechowywana.Aby uzyskać więcej informacji zobacz Encrypting Connections to SQL Server.

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

sp_addpushsubscription_agent [ @publication= ] 'publication'
    [ , [ @subscriber = ] 'subscriber' ]
    [ , [ @subscriber_db = ] 'subscriber_db' ]
    [ , [ @subscriber_security_mode = ] subscriber_security_mode ]
    [ , [ @subscriber_login = ] 'subscriber_login' ]
    [ , [ @subscriber_password = ] 'subscriber_password' ]
    [ , [ @job_login = ] 'job_login' ] 
    [ , [ @job_password = ] 'job_password' ] 
    [ , [ @job_name = ] 'job_name' ] 
    [ , [ @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 ]
    [ , [ @dts_package_name = ] 'dts_package_name' ]
    [ , [ @dts_package_password = ] 'dts_package_password' ]
    [ , [ @dts_package_location = ] 'dts_package_location' ]
    [ , [ @enabled_for_syncmgr = ] 'enabled_for_syncmgr' ]
    [ , [ @distribution_job_name = ] 'distribution_job_name' ]
    [ , [ @publisher = ] 'publisher' ]
    [ , [ @subscriber_provider = ] 'subscriber_provider' ] 
    [ , [ @subscriber_datasrc = ] 'subscriber_datasrc' ] 
    [ , [ @subscriber_location = ] 'subscriber_location' ]
    [ , [ @subscriber_provider_string = ] 'subscriber_provider_string' ] 
    [ , [ @subscriber_catalog = ] 'subscriber_catalog' ]

Argumenty

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

  • [ @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_db is sysname, with a default of NULL.Dla innych niż-programu SQL Server subskrybent, podaj wartość (domyślne obiekt obiekt docelowy) for subscriber_db.

  • [ @subscriber_security_mode =] subscriber_security_mode
    Is the security mode to use when connecting to a Subscriber when synchronizing.subscriber_security_mode is int, with a default of 1.0 Określa, SQL Server Uwierzytelnianie. 1 Określa uwierzytelnianie systemu Windows.

    Security noteSecurity Note:

    Kolejce subskrypcji aktualizacji należy użyć SQL Server Uwierzytelnianie dla połączeń do subskrybent i określ inne konto dla połączenia z każdym subskrybent. Dla wszystkich innych subskrypcji za pomocą uwierzytelnianie systemu Windows.

  • [ @subscriber_login =] 'subscriber_login'
    Czy logowania subskrybent do użycia podczas podłączania do subskrybent podczas synchronizacji. subscriber_login jest sysname, z domyślną wartość NULL.

  • [ @subscriber_password =] 'subscriber_password'
    Is the Subscriber password.subscriber_password is required if subscriber_security_mode is set to 0.subscriber_password is sysname, with a default of NULL.Jeśli używane jest hasło abonenta, są automatycznie szyfrowane.

    Security noteSecurity Note:

    Nie należy używać pustego hasła.Należy używać silnego hasła.Jeśli jest to możliwe, monituje użytkowników o wprowadzenie poświadczenia zabezpieczeń w czasie wykonywania.Jeśli poświadczenia muszą być przechowywane w pliku skryptu, należy zabezpieczyć plik, aby uniemożliwić nieautoryzowany dostęp.

  • [ @job_login = ] 'job_login'
    Is the login for the Windows account under which the agent runs.job_login is nvarchar(257), with a default value of NULL.Tego konta systemu Windows jest zawsze używana dla połączeń agenta dystrybutor i połączeń z subskrybent, stosując uwierzytelnianie zintegrowane systemu Windows.

  • [ @job_password = ] 'job_password'
    Is the password for the Windows account under which the agent runs.job_password is sysname, with no default.

    Security noteSecurity Note:

    Jeśli jest to możliwe, monituje użytkowników o wprowadzenie poświadczenia zabezpieczeń w czasie wykonywania.Jeśli poświadczenia muszą być przechowywane w pliku skryptu, należy zabezpieczyć plik, aby uniemożliwić nieautoryzowany dostęp.

  • [ @job_name = ] 'job_name'
    Is the name of an existing agent job.job_name is sysname, with a default value of NULL.Ten parametr jest określony tylko wtedy, gdy subskrypcja zostaną zsynchronizowane przy użyciu istniejącego zadanie, a nie do nowo utworzonego zadanie (ustawienie domyślne).Jeśli nie jesteś członkiem sysadmin roli serwera stałe, należy określić job_login i job_password Po określeniu job_name.

  • [ @frequency_type = ] frequency_type
    Is the frequency with which to schedule the Distribution Agent.frequency_type is int, and can be one of the following values.

    Wartość

    Description

    1

    Jeden raz

    2

    Na żądanie

    4

    Dzienne

    8

    Co tydzień

    16

    Miesięczne

    32

    Względna miesięczne

    64 (domyślnie)

    Autostart

    128

    Cykliczne

    Uwaga

    Określanie wartości 64 powoduje, że Agent dystrybucji do pracy w trybie ciągłym.Odpowiada to ustawieniu -Ciągłe parametr dla agenta.Aby uzyskać więcej informacji zobacz Replication Distribution Agent.

  • [ @frequency_interval = ] frequency_interval
    Is the value to apply to the frequency set by frequency_type.frequency_interval is int, with a default of 1.

  • [ @frequency_relative_interval = ] frequency_relative_interval
    Jest to data Agent dystrybucji.This parameter is used when frequency_type is set to 32 (monthly relative).frequency_relative_interval is int, and can be one of the following values.

    Wartość

    Description

    1 (domyślnie)

    First

    2

    Sekundy

    4

    Trzecia

    8

    Czwarty

    16

    Last

  • [ @frequency_recurrence_factor = ] frequency_recurrence_factor
    Is the recurrence factor used by frequency_type.frequency_recurrence_factor is int, with a default of 0.

  • [ @frequency_subday = ] frequency_subday
    Is how often to reschedule during the defined period.frequency_subday is int, and can be one of the following values.

    Wartość

    Description

    1

    Tylko raz

    2

    Sekundy

    4 (domyślnie)

    Minuta

    8

    Godziny

  • [ @frequency_subday_interval = ] frequency_subday_interval
    Is the interval for frequency_subday.frequency_subday_interval is int, with a default of 5.

  • [ @active_start_time_of_day = ] active_start_time_of_day
    Is the time of day when the Distribution Agent is first scheduled, formatted as HHMMSS.active_start_time_of_day is int, with a default of 0.

  • [ @active_end_time_of_day = ] active_end_time_of_day
    Is the time of day when the Distribution Agent stops being scheduled, formatted as HHMMSS.active_end_time_of_day is int, with a default of 235959.

  • [ @active_start_date = ] active_start_date
    Is the date when the Distribution Agent is first scheduled, formatted as YYYYMMDD.active_start_date is int, with a default of 0.

  • [ @active_end_date = ] active_end_date
    Is the date when the Distribution Agent stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of 99991231.

  • [ @dts_package_name = ] 'dts_package_name'
    Specifies the name of the Data Transformation Services (DTS) package.dts_package_name is a sysname with a default of NULL.Na przykład, aby określić nazwę pakiet DTSPub_Package, ten parametr może być @dts\_package\_name = N'DTSPub_Package'.

  • [ @dts_package_password = ] 'dts_package_password'
    Specifies the password required to run the package.dts_package_password is sysname with a default of NULL.

    Uwaga

    Jeśli musisz określić hasło dts_package_name jest określony.

  • [ @dts_package_location = ] 'dts_package_location'
    Specifies the package location.dts_package_location is a nvarchar(12), with a default of DISTRIBUTOR.Być może lokalizacja pakiet dystrybutor or Subskrybent.

  • [ @enabled_for_syncmgr = ] 'enabled_for_syncmgr'
    Is whether the subscription can be synchronized through Microsoft Synchronization Manager.enabled_for_syncmgr is nvarchar(5), with a default of FALSE.Jeśli false, subskrypcja nie został zarejestrowany z menedżer synchronizacji. Jeśli true, subskrypcja jest zarejestrowany z menedżer synchronizacji i mogą być synchronizowane bez konieczności uruchamiania SQL Server Management Studio.

  • [ @distribution_job_name = ] 'distribution_job_name'
    Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

  • [ @publisher = ] 'publisher'
    Is the name of the Publisher.publisher is sysname, with a default value of NULL.

  • [ @subscriber_provider= ] 'subscriber_provider'
    Is the unique programmatic identifier (PROGID) with which the OLE DB provider for the non-SQL Server data source is registered.subscriber_provider is sysname, with default value of NULL.subscriber_provider must be unique for the OLE DB provider installed on the Distributor.subscriber_provider is only supported for non-SQL Server Subscribers.

  • [ @subscriber_datasrc= ] 'subscriber_datasrc'
    Is the name of the data source as understood by the OLE DB provider.subscriber_datasrc is nvarchar(4000), with a default value of NULL.subscriber_datasrc is passed as the DBPROP_INIT_DATASOURCE property to initialize the OLE DB provider.subscriber_datasrc is only supported for non-SQL Server Subscribers.

  • [ @subscriber_location= ] 'subscriber_location'
    Is the location of the database as understood by the OLE DB provider.subscriber_location is nvarchar(4000), with a default value of NULL.subscriber_location is passed as the DBPROP_INIT_LOCATION property to initialize the OLE DB provider.subscriber_location is only supported for non-SQL Server Subscribers.

  • [ @subscriber_provider_string= ] 'subscriber_provider_string'
    Is the OLE DB provider-specific connection string that identifies the data source.subscriber_provider_string is nvarchar(4000), with a default value of NULL.subscriber_provider_string is passed to IDataInitialize or set as the DBPROP_INIT_PROVIDERSTRING property to initialize the OLE DB provider.subscriber_provider_string is only supported for non-SQL Server Subscribers.

  • [ @subscriber_catalog= ] 'subscriber_catalog'
    Is the catalog to be used when making a connection to the OLE DB provider.subscriber_catalog is sysname, with default value of NULL.subscriber_catalog is passed as the DBPROP_INIT_CATALOG property to initialize the OLE DB provider.subscriber_catalog is only supported for non-SQL Server Subscribers.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

sp_addpushsubscription_agent jest używana w przypadku replikacja migawka i replikacji transakcyjnej.

Uprawnienia

Tylko członkowie sysadmin Rola serwera lub db_owner stała rola bazy danych może być wykonywany sp_addpushsubscription_agent.