sp_changesubscriber (Transact-SQL)
適用於:SQL Server Azure SQL 受控執行個體
變更訂閱者的選項。 此發行者之訂閱者的任何散發工作都會更新。 這個預存程式會 寫入散發資料庫中MSsubscriber_info 數據表。 這個預存程式會在發行集資料庫的發行者端執行。
語法
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
這是訂閱者類型。 類型 為 tinyint,預設值為 NULL。 0 表示 SQL Server 訂閱者Microsoft。 1 指定非 SQL Server 或其他 ODBC 資料源伺服器訂閱者。
[ @login = ] 'login'
這是 SQL Server 驗證登入識別碼。 login 是 sysname,預設值為 NULL。
[ @password = ] 'password'
這是 SQL Server 驗證密碼。 password 為 sysname,預設值為 %。 % 表示密碼屬性沒有變更。
[ @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 | First |
2 | 第二個 |
4 | Third |
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 | Minute |
8 | Hour |
[ @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用於所有類型的複寫。
權限
只有系統管理員固定伺服器角色的成員可以執行sp_changesubscriber。
另請參閱
sp_addsubscriber (Transact-SQL)
sp_dropsubscriber (Transact-SQL)
sp_helpdistributiondb (Transact-SQL)
sp_helpserver (Transact-SQL)
sp_helpsubscriberinfo (Transact-SQL)
系統預存程序 (Transact-SQL)
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應