I assume you mean, the 2nd, 3rd or
4th columns, mirroring the example from BOL, since 2+4+8=14.
[tt] IF (COLUMNS_UPDATED() & 14) = 14 to see if all of columns 2, 3, and 4 are updated.*/[/tt]
The value returned by COLUMNS_UPDATED is a bitwise representation of the columns in the table: a set of switches turned on or off, 1 or 0, updated or not.
The leftmost column in the table is represented by the leftmost bit position, the next the second position, etc. The value of that position is 2
position.
[tt]Name Col1 Col2 Col3 Col4
Position 1 2 3 4
Value 1 2 4 8[/tt]
The valuation only applied if the bit is turned on, otherwise the value is 0. With COLUMNS_UPDATED, the bit will only be on if the column in that position has been updated. Up to 8 columns can be tested easily. Check out BOL for more details on more than 8 columns.
The ampersand (&) is a bitwise operator that looks at the value of each bit.
[tt](COLUMNS_UPDATED() & 14) = 14[/tt]
could be written
[tt](COLUMNS_UPDATED() & 2+4+8) = 14[/tt]
Since the values 2, 4, and 8 represent positions 2, 3, and 4 respectively, I read this script as, "Have columns 2, 3, and 4 ALL been updated?"
Note that your example above is slightly different than BOL:
[tt]if ((columns_updated() & 2 + 4 + 8))
> 0)[/tt]
I read this script as, "Have ANY of columns 2, 3, and 4 been updated?"
I hope this helps. Good luck!
--John
![[rainbow] [rainbow] [rainbow]](/data/assets/smilies/rainbow.gif)
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)