Search code examples
sql-serverchange-tracking

CHANGE_TRACKING_IS_COLUMN_IN_MASK when value has not changed


Imagine I have a table with change tracking enabled, and I update a column of the table for a given primary key. The value I update with is the SAME value as was already there before.

Looking on the docs, MSDN says that this function will return true if the column is in the collection change_columns.

CHANGE_TRACKING_IS_COLUMN_IN_MASK returns the following values.

0: The specified column is not in the change_columns list.

1: The specified column is in the change_columns list.

Looking further, the change_columns list is a wrapper around the CHANGETABLE.SYS_CHANGE_COLUMNS property, which is defined as:

Lists the columns that have changed since the last_sync_version (the baseline).

Which is ambiguous. What does "changed" mean in this context? If the value is the same then has it changed?

Anyone know the answer?


Solution

  • I just tried it and can report that yes, CHANGE_TRACKING_IS_COLUMN_IN_MASK returns true when a column value has been changed, regardless of what the actual change delta was.