May 10, 2004 at 1:31 am
Hi,
pls can anyone explain me what does "status&64=64" mean ?
i cant find any explaination of it in BOL...
tks
May 10, 2004 at 5:43 am
It is a BIT field test.
The & means BIT AND. BIT AND means if both bits are set then return a value.
BIT OR means if either BIT is set then return a value.
See my article for further details on bitwise operators http://www.sqlservercentral.com/columnists/dpoole/usingbitstostoredata_printversion.asp
May 10, 2004 at 5:48 am
It's bitwise operation.
& for bitwise AND
64 = binary 1000000
status&64=64 is checking if status column has that bit(s) been set.
Refer BOL for detail info on bitwise operators.
May 11, 2004 at 4:17 am
It's a bitwise mask!! bitwise mask is used in trigger.
EXAMPLE:
You have a table of 5 columns A, B, C, D and E
Check whether columns 2, 3 or 4 has been updated.
A) To check if all columns 2, 3, and 4 are updated, use = 14 in place of >0 (below).
- IF (COLUMNS_UPDATED() & 14) > 0
B) Use to see if all of columns 2, 3, and 4 are updated.
- IF (COLUMNS_UPDATED() & 14) = 14
COLS A B C D E
BIT 0 1 1 1 0
Read this from right 1110(Binary) = 14 (decimal)
If you have problem tell me!!
Frank!!
May 17, 2004 at 9:22 am
hi everybody,
tks for ur kindness & explainations.
good day
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply