sys.sp_cdc_scan (Transact-SQL)

適用於:SQL Server

執行異動數據擷取記錄掃描作業。

Transact-SQL 語法慣例

語法

sys.sp_cdc_scan [ [ @maxtrans = ] max_trans ]
    [ , [ @maxscans = ] max_scans ]
    [ , [ @continuous = ] continuous ]
    [ , [ @pollinginterval = ] polling_interval ]
[ ; ]

引數

[ @maxtrans = ] max_trans

每個掃描週期中要處理的交易數目上限。 @maxtrans是 int,預設值為 500

[ @maxscans = ] max_scans

要執行的掃描週期數目上限,以便從記錄檔擷取所有數據列。 @maxscans的預設值10int

[ @continuous = ] continuous

指出預存程式在執行單一掃描週期 () 或連續執行之後,是否應該在重新執行掃描週期 (0) 之前暫停@pollinginterval所指定的1時間。 @continuous為 tinyint,預設值為 0

[ @pollinginterval = ] polling_interval

記錄掃描週期之間的秒數。 @pollinginterval是 bigint,預設值為 0

傳回碼值

0 (成功)或 1 (失敗)。

結果集

無。

備註

sys.sp_cdc_scan 如果 SQL Server Agent 擷取作業正由異動數據擷取使用,則會在內部 sys.sp_MScdc_capture_job 呼叫 。 當異動數據擷取記錄掃描作業已作用中,或資料庫啟用事務複製時,就無法明確執行此程式。 這個預存程式應該由想要自定義自動設定之擷取作業行為的系統管理員使用。

權限

需要 db_owner 固定資料庫角色中的成員資格。