Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SYS_CHANGES_COLUMNS - find updated columns

$
0
0

In changetracking table, there is binary columns with name: SYS_CHANGES_COLUMNS. It's value is for example:

0x0000000017000000180000004900000001000000

It includes the columns which were changed at update statement. How can i check if any of the columns which I would like to track was changed. For example, columns with position 3, 15 and 21 in the table.

I guess it could be done with binary operations.

To test if third column was changed:

SELECT substring(SYS_CHANGES_COLUMNS,1,1)&3 ) = 3

Any suggestion?

br, Simon


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>