sp_changedistributiondb (Transact-SQL)
適用於:SQL ServerAzure SQL 受控執行個體
變更散發資料庫的屬性。 此預存程式會在任何資料庫的散發者端執行。
語法
sp_changedistributiondb [ @database= ] 'database'
[ , [ @property= ] 'property' ]
[ , [ @value= ] 'value' ]
引數
[ @database = ] 'database'
這是散發資料庫的名稱。 database 是 sysname,沒有預設值。
[ @property = ] 'property'
這是要變更指定資料庫的屬性。 屬性 是 sysname,可以是下列其中一個值。
值 | Description |
---|---|
history_retention | 記錄數據表保留期間。 |
max_distretention | 散發保留期間上限。 |
min_distretention | 最小散發保留期限。 |
NULL (預設值) | 列印所有可用的 屬性值 。 |
[ @value = ] 'value'
這是指定之屬性的新值。 值為 nvarchar(255),預設值為 NULL。
傳回碼值
0 (成功) 或 1 (失敗)
備註
sp_changedistributiondb用於所有類型的複寫。
範例
DECLARE @distributionDB AS sysname;
SET @distributionDB = N'distribution';
-- Change the history retention period to 24 hours and the
-- maximum retention period to 48 hours.
USE distribution
EXEC sp_changedistributiondb @distributionDB, N'history_retention', 24
EXEC sp_changedistributiondb @distributionDB, N'max_distretention', 48
GO
權限
只有系統管理員固定伺服器角色的成員可以執行sp_changedistributiondb。
另請參閱
檢視及修改散發者和發行者屬性
sp_adddistributiondb (Transact-SQL)
sp_dropdistributiondb (Transact-SQL)
sp_helpdistributiondb (Transact-SQL)
複寫預存程式 (Transact-SQL)
意見反映
https://aka.ms/ContentUserFeedback。
即將推出:我們會在 2024 年淘汰 GitHub 問題,並以全新的意見反應系統取代並作為內容意見反應的渠道。 如需更多資訊,請參閱:提交及檢視以下的意見反映: