sp_changesubstatus (języka Transact-SQL)

Zmienia stan istniejących subskrybent.Ta procedura przechowywana jest wykonywana przez wydawcę na baza danych publikacja.

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

sp_changesubstatus [ [ @publication = ] 'publication' ]
    [ , [ @article = ] 'article' ]
    [ , [ @subscriber = ] 'subscriber' ]
        , [ @status = ] 'status'
    [ , [ @previous_status = ] 'previous_status' ]
    [ , [ @destination_db = ] 'destination_db' ]
    [ , [ @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' ]
    [ , [ @distribution_jobid = ] distribution_jobid ]
    [ , [ @from_auto_sync = ] from_auto_sync ]
    [ , [ @ignore_distributor = ] ignore_distributor ]
    [ , [ @offloadagent= ] remote_agent_activation ]
    [ , [ @offloadserver= ] 'remote_agent_server_name' ]
    [ , [ @dts_package_name= ] 'dts_package_name' ]
    [ , [ @dts_package_password= ] 'dts_package_password' ]
    [ , [ @dts_package_location= ] dts_package_location ]
    [ , [ @skipobjectactivation = ] skipobjectactivation
  [ , [ @distribution_job_name= ] 'distribution_job_name' ]
    [ , [ @publisher = ] 'publisher' ]

Argumenty

  • [ @publication=] 'publication'
    Is the name of the publication.publication is sysname, with a default of %.Jeśli publication nie jest określony, polecenie dotyczy wszystkich publikacji.

  • [ @article=] 'article'
    Jest nazwą artykuł.It must be unique to the publication.article is sysname, with a default of %.Jeśli article nie jest określony, polecenie dotyczy wszystkich artykułów.

  • [ @subscriber=] 'subscriber'
    Is the name of the Subscriber to change the status of.subscriber is sysname, with a default of %.Jeśli subscriber nie jest określony, stan zmienia się do wszystkich subskrybentów określonego artykuł.

  • [ @status =] 'status'
    Is the subscription status in the syssubscriptions table.status is sysname, with no default, and can be one of these values.

    Wartość

    Description

    aktywne

    Subskrybent są synchronizowane i odbiera dane.

    nieaktywne

    Istnieje wpis subskrybent bez subskrypcja.

    subskrybowane

    Subskrybent żąda danych, ale nie jest jeszcze zsynchronizowane.

  • [ @previous_status=] 'previous_status'
    Is the previous status for the subscription.previous_status is sysname, with a default of NULL.Ten parametr umożliwia zmianę żadnych subskrypcji, które aktualnie mają o stanie, umożliwiając funkcji grup na określonym zestaw subskrypcji (na przykład zestaw ting wszystkich aktywnych subskrypcji z powrotem do subskrybowane).

  • [ @destination_db=] 'destination_db'
    Is the name of the destination database.destination_db is sysname, with a default of %.

  • [ @frequency_type=] frequency_type
    Is the frequency with which to schedule the distribution task.frequency_type is int, with a default of NULL.

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

  • [ @frequency_relative_interval=] frequency_relative_interval
    Jest to Data zadania rozkład.This parameter is used when frequency_type is set to 32 (monthly relative).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_factor is int, with a default of NULL.

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

    Wartość

    Description

    1

    Tylko raz

    2

    Sekundy

    4

    Minuta

    8

    Godziny

    NULL(default)

     

  • [ @frequency_subday_interval=] frequency_subday_interval
    Is the interval for frequency_subday.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 distribution task 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 distribution task 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 distribution task 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 distribution task stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of NULL.

  • [ @optional_command_line=] 'optional_command_line'
    Is an optional command prompt.optional_command_line is nvarchar(4000), with a default of NULL.

  • [ @distribution_jobid=] distribution_jobid
    Jest to identyfikator zadanie agenta dystrybucji na dystrybutor subskrypcja, podczas zmiany stanu subskrypcja z nieaktywne do aktywnego.W innych przypadkach nie jest zdefiniowane.If more than one Distribution Agent is involved in a single call to this stored procedure, the result is not defined.distribution_jobid is binary(16), with a default of NULL.

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

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

  • [ @offloadagent= ] remote_agent_activation

    Uwaga

    Aktywacja agenta zdalnego została zastąpiona i nie jest już obsługiwany.Ten parametr jest obsługiwany tylko w celu zachowania zgodności ze starszymi wersjami skryptów.Ustawienie remote_agent_activation wartość inną niż 0 generuje błąd.

  • [ @offloadserver= ] 'remote_agent_server_name'

    Uwaga

    Aktywacja agenta zdalnego została zastąpiona i nie jest już obsługiwany.Ten parametr jest obsługiwany tylko w celu zachowania zgodności ze starszymi wersjami skryptów.Ustawienie remote_agent_server_name generuje błąd, do każdej wartości inne niż NULL.

  • [ @ 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 w przypadku pakiet o nazwie DTSPub_Package określić, @dts\_package\_name = N'DTSPub_Package'.

  • [ @ dts_package_password= ] "dts_package_password'
    Specifies the password on the package.dts_package_password is sysname with a default of NULL, which specifies that the password property is to be left unchanged.

    Uwaga

    Pakiet DTS musi mieć hasło.

  • [ @ dts_package_location= ] dts_package_location
    Specifies the package location.dts_package_location is an int, with a default of 0.Jeśli 0, lokalizacja pakiet jest dystrybutor.Jeśli 1, lokalizacja pakiet jest przez subskrybent.Być może lokalizacja pakiet dystrybutor or Subskrybent.

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

  • [ @distribution_job_name= ] 'distribution_job_name'
    Is the name of the distribution job.distribution_job_name is sysname, with a default of NULL.

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

    Uwaga

    publisher nie należy używać podczas zmiany właściwości artykuł na SQL Server Wydawca.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

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

sp_changesubstatus zmienia stan abonenta w syssubscriptions tabela z zmieniony stan.Jeśli to konieczne, aktualizuje stan artykuł sysarticles tabela, aby wskazać aktywne lub nieaktywne.Jeśli to konieczne, to ustawia flagę replikacja lub wyłączyć sysobjects tabela w zreplikowanej tabela.

Uprawnienia

Tylko członkowie sysadmin stała rola serwera db_owner ustalić rola bazy danych lub twórca subskrypcja mogą wykonać sp_changesubstatus.