sp_changedistributiondb (Transact-SQL)

變更散發資料庫的屬性。 這個預存程序執行於任何資料庫中的散發者端。

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

語法

sp_changedistributiondb [ @database= ] 'database' 
    [ , [ @property= ] 'property' ] 
    [ , [ @value= ] 'value' ]

引數

  • [ @database=] 'database'
    這是散發資料庫的名稱。 databasesysname,沒有預設值。

  • [ @property=] 'property'
    這是給定資料庫要變更的屬性。 propertysysname,而且可以是下列其中一個值。

    說明

    history_retention

    記錄資料表保留期限。

    max_distretention

    最大散發保留期限。

    min_distretention

    最小散發保留期限。

    NULL (預設值)

    列印所有可用的 property 值。

  • [ @value=] 'value'
    這是指定屬性的新值。 valuenvarchar(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 

權限

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

請參閱

參考

sp_adddistributiondb (Transact-SQL)

sp_dropdistributiondb (Transact-SQL)

sp_helpdistributiondb (Transact-SQL)

複寫預存程序 (Transact-SQL)

概念

檢視及修改散發者和發行者屬性