sp_changesubscriber (Transact-SQL)

變更訂閱者的選項。這個發行者之訂閱者的任何散發工作都會更新。這個預存程序會寫入散發資料庫的 MSsubscriber_info 資料表中。這個預存程序執行於發行集資料庫的發行者端。

主題連結圖示Transact-SQL 語法慣例

語法


sp_changesubscriber [ @subscriber= ] 'subscriber'
    [ , [ @type= ] type ]
    [ , [ @login= ] 'login' ]
    [ , [ @password= ] 'password' ]
    [ , [ @commit_batch_size= ] commit_batch_size ]
    [ , [ @status_batch_size= ] status_batch_size ]
    [ , [ @flush_frequency= ] flush_frequency ]
    [ , [ @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 ]
    [ , [ @description= ] 'description' ]
    [ , [ @security_mode= ] security_mode ]
    [ , [ @publisher = ] 'publisher' ]

引數

  • [@subscriber=] 'subscriber'
    這是要變更選項之訂閱者的名稱。subscriber 是 sysname,沒有預設值。

  • [@type=] type
    這是訂閱者類型。type 是 tinyint,預設值是 NULL。0 表示 Microsoft SQL Server 訂閱者。1 指定非 SQL Server 或其他 ODBC 資料來源伺服器訂閱者。

  • [@login=] 'login'
    這是 SQL Server 驗證登入識別碼。login 是 sysname,預設值是 NULL。

  • [@password=] 'password'
    這是 SQL Server 驗證密碼。password 是 sysname,預設值是 %% 表示 password 屬性沒有變更。

  • [@commit_batch_size=] commit_batch_size
    支援這個項目的目的,只是為了與舊版相容。

  • [@status_batch_size=] status_batch_size
    支援這個項目的目的,只是為了與舊版相容。

  • [@flush_frequency=] flush_frequency
    支援這個項目的目的,只是為了與舊版相容。

  • [@frequency_type=] frequency_type
    這是散發工作的排程頻率。frequency_type 是 int,它可以是下列值之一。

    描述

    1

    一次

    2

    視需要

    4

    每日

    8

    每週

    16

    每月

    32

    每月相對

    64

    自動啟動

    128

    重複執行

  • [@frequency_interval=] frequency_interval
    這是 frequency_type 的間隔。frequency_interval 是 int,預設值是 NULL。

  • [@frequency_relative_interval=] frequency_relative_interval
    這是散發工作的日期。當 frequency_type 設定為 32 (每月相對) 時,則使用這個參數。frequency_relative_interval 是 int,它可以是下列值之一。

    描述

    1

    第一個

    2

    4

    第三個

    8

    第四個

    16

    最後一個

  • [@frequency_recurrence_factor=] frequency_recurrence_factor
    這是在定義的 frequency_type 期間,應該循環執行散發工作的頻率。frequency_recurrence_factor 是 int,預設值是 NULL。

  • [@frequency_subday=] frequency_subday
    在定義的期間內,重新排程的頻率。frequency_subday 是 int,它可以是下列值之一。

    描述

    1

    一次

    2

    4

    分鐘

    8

    小時

  • [@frequency_subday_interval=] frequency_subday_interval
    這是 frequence_subday 的間隔。frequency_subday_interval 是 int,預設值是 NULL。

  • [@active_start_time_of_day=] active_start_time_of_day
    這是第一次排程散發工作的當日時間,格式為 HHMMSS。active_start_time_of_day 是 int,預設值是 NULL。

  • [@active_end_time_of_day=] active_end_time_of_day
    這是排程停止散發工作的當日時間,格式為 HHMMSS。active_end_time_of_day 是 int,預設值是 NULL。

  • [@active_start_date=] active_start_date
    這是第一次排程散發工作的日期,格式為 YYYYMMDD。active_start_date 是 int,預設值是 NULL。

  • [@active_end_date=] active_end_date
    這是排程停止散發工作的日期,格式為 YYYYMMDD。active_end_date 是 int,預設值是 NULL。

  • [@description=] 'description'
    這是選擇性的文字描述。description 是 nvarchar(255),預設值是 NULL。

  • [@security_mode=] security_mode
    這是實作的安全性模式。security_mode 是 int,它可以是下列值之一。

    描述

    0

    SQL Server 驗證

    1

    Windows 驗證

  • [@publisher= ] 'publisher'
    指定非 SQL Server 發行者。publisher 是 sysname,預設值是 NULL。

    [!附註]

    當在 SQL Server 發行者上變更發行項屬性時,不應使用 publisher。

傳回碼值

0 (成功) 或 1 (失敗)

備註

sp_changesubscriber 用於所有類型的複寫中。

權限

只有系統管理員 (sysadmin) 固定伺服器角色的成員,才能夠執行 sp_changesubscriber