CHANGE_TRACKING_IS_COLUMN_IN_MASK (Transact-SQL)CHANGE_TRACKING_IS_COLUMN_IN_MASK (Transact-SQL)

適用於: 是SQL Server 是Azure SQL Database 否Azure SQL 資料倉儲 否平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

解譯 CHANGETABLE(CHANGES...) 函式所傳回的 SYS_CHANGE_COLUMNS 值。Interprets the SYS_CHANGE_COLUMNS value that is returned by the CHANGETABLE(CHANGES ...) function. 這可讓應用程式決定指定的資料行是否要包含在針對 SYS_CHANGE_COLUMNS 傳回的值中。This enables an application to determine whether the specified column is included in the values that are returned for SYS_CHANGE_COLUMNS.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

  
CHANGE_TRACKING_IS_COLUMN_IN_MASK ( column_id , change_columns )  

引數Arguments

column_idcolumn_id
要經過檢查之資料行的識別碼。Is the ID of the column that is being checked. 要取得 ID,請使用資料行COLUMNPROPERTY函式。The column ID can be obtained by using the COLUMNPROPERTY function.

change_columnschange_columns
二進位資料之 SYS_CHANGE_COLUMNS 資料行CHANGETABLE資料。Is the binary data from the SYS_CHANGE_COLUMNS column of the CHANGETABLE data.

傳回類型Return Type

bitbit

傳回值Return Values

CHANGE_TRACKING_IS_COLUMN_IN_MASK 會傳回下列值。CHANGE_TRACKING_IS_COLUMN_IN_MASK returns the following values.

傳回值Return value 描述Description
00 指定的資料行不是處於change_columns清單。The specified column is not in the change_columns list.
11 指定的資料行正處於change_columns清單。The specified column is in the change_columns list.

備註Remarks

CHANGE_TRACKING_IS_COLUMN_IN_MASK 不會執行任何檢查來驗證column_id值,或change_columns參數已經從資料表取得column_id取得。CHANGE_TRACKING_IS_COLUMN_IN_MASK does not perform any checks to validate the column_id value or that the change_columns parameter was obtained from the table from which the column_id was obtained.

範例Examples

下列範例可判斷是否更新 Salary 資料表的 Employees 資料行。The following example determines whether the Salary column of the Employees table was updated. COLUMNPROPERTY函式會傳回的資料行識別碼Salary資料行。The COLUMNPROPERTY function returns the column ID of the Salary column. @change_columns 區域變數必須使用 CHANGETABLE 設定為查詢結果,做為資料來源。The @change_columns local variable must be set to the results of a query by using CHANGETABLE as a data source.

SET @SalaryChanged = CHANGE_TRACKING_IS_COLUMN_IN_MASK  
    (COLUMNPROPERTY(OBJECT_ID('Employees'), 'Salary', 'ColumnId')  
    ,@change_columns);  

另請參閱See Also

變更追蹤函數 (Transact-SQL) Change Tracking Functions (Transact-SQL)
CHANGETABLE (Transact-SQL) CHANGETABLE (Transact-SQL)
追蹤資料變更 (SQL Server)Track Data Changes (SQL Server)