sp_change_agent_parameter (Transact-SQL)

變更 MSagent_parameters 系統資料表所儲存之複寫代理程式設定檔的參數。這個預存程序執行於在任何資料庫執行代理程式的散發者端。

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

語法

sp_change_agent_parameter [ @profile_id= ] profile_id, [ @parameter_name= ] 'parameter_name', [ @parameter_value= ] 'parameter_value'

引數

  • [@profile_id=] profile_id,
    這是設定檔的識別碼。profile_id 是 int,沒有預設值。

  • [@parameter_name=] 'parameter_name'
    這是參數的名稱。parameter_name 是 sysname,沒有預設值。系統設定檔可以變更的參數會隨著代理程式的類型而不同。若要知道這個 profile_id 所代表的代理程式類型,請找出 Msagent_profiles 資料表中的 profile_id 資料行,記下 agent_type 值。

    [!附註]

    如果支援給定 agent_type 的某個參數,但尚未在代理程式設定檔中定義這個參數,就會傳回錯誤。若要將參數加入代理程式設定檔中,您必須執行 sp_add_agent_parameter

    對於快照集代理程式 (agent_type=1),如果是定義在設定檔中,您可以變更下列屬性:

    • 70Subscribers

    • BcpBatchSize

    • HistoryVerboseLevel

    • LoginTimeout

    • MaxBcpThreads

    • MaxNetworkOptimization

    • Output

    • OutputVerboseLevel

    • PacketSize

    • QueryTimeout

    • StartQueueTimeout

    • UsePerArticleContentsView

    對於記錄讀取器代理程式 (agent_type=2),如果是定義在設定檔中,您可以變更下列屬性:

    • HistoryVerboseLevel

    • LoginTimeout

    • MessageInterval

    • Output

    • OutputVerboseLevel

    • PacketSize

    • PollingInterval

    • QueryTimeout

    • ReadBatchSize

    • ReadBatchThreshold

    對於散發代理程式 (agent_type=3),如果是定義在設定檔中,您可以變更下列屬性:

    • BcpBatchSize

    • CommitBatchSize

    • CommitBatchThreshold

    • FileTransferType

    • HistoryVerboseLevel

    • KeepAliveMessageInterval

    • LoginTimeout

    • MaxBcpThreads

    • MaxDeliveredTransactions

    • MessageInterval

    • Output

    • OutputVerboseLevel

    • PacketSize

    • PollingInterval

    • QueryTimeout

    • QuotedIdentifier

    • SkipErrors

    • TransactionsPerHistory

    對於合併代理程式 (agent_type=4),如果是定義在設定檔中,您可以變更下列屬性:

    • AltSnapshotFolder

    • BcpBatchSize

    • ChangesPerHistory

    • DestThreads

    • DownloadGenerationsPerBatch

    • DownloadReadChangesPerBatch

    • DownloadWriteChangesPerBatch

    • DynamicSnapshotLocation

    • ExchangeType

    • FastRowCount

    • FileTransferType

    • GenerationChangeThreshold

    • HistoryVerboseLevel

    • InputMessageFile

    • InteractiveResolution

    • InterruptOnMessagePattern

    • KeepAliveMessageInterval

    • LoginTimeout

    • MaxBcpThreads

    • MaxDownloadChanges

    • MaxUploadChanges

    • MetadataRetentionCleanup

    • NumDeadlockRetries

    • Output

    • OutputMessageFile

    • OutputVerboseLevel

    • PacketSize

    • ParallelUploadDownload

    • PauseOnMessagePattern

    • PauseTime

    • PollingInterval

    • ProcessMessagesAtPublisher

    • ProcessMessagesAtSubscriber

    • QueryTimeout

    • QueueSizeMultiplier

    • SrcThreads

    • StartQueueTimeout

    • SyncToAlternate

    • UploadGenerationsPerBatch

    • UploadReadChangesPerBatch

    • UploadWriteChangesPerBatch

    • UseInprocLoader

    • Validate

    • ValidateInterval

    對於佇列讀取器代理程式 (agent_type=9),如果是定義在設定檔中,您可以變更下列屬性:

    • HistoryVerboseLevel

    • LoginTimeout

    • Output

    • OutputVerboseLevel

    • PollingInterval

    • QueryTimeout

    • ResolverState

    • SQLQueueMode

    若要知道給定設定檔定義了哪些參數,請執行 sp_help_agent_profile,記下關聯於 profile_id 的 profile_name。之後,請利用這個 profile_id 來執行 sp_help_agent_parameters,以查看關聯於這個設定檔的參數。您可以執行 sp_add_agent_parameter,將參數加入設定檔中。

  • [@parameter_value=] 'parameter_value'
    這是參數的新值。parameter_value 是 nvarchar(255),沒有預設值。

傳回碼值

0 (成功) 或 1 (失敗)

備註

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

權限

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