I need to interrogate a particular bit in a binary string.
If I take the number 56246 and convert it to binary using the windows calculator I end up with this binary string 1101101110110110
I am interested in determining the status of the bold bit.
If I take the number 56246 that is stored in my database and CONVERT it to binary, I seem to get a HEX value.
DELCARE @i int, @b binary(16)
SET @i = 56246
SET @b = CONVERT(binary(16), @i)
PRINT @b
I have no idea how to decide if the bit I want to check is a 1 or 0.
Any help would be most appreciated!
If I take the number 56246 and convert it to binary using the windows calculator I end up with this binary string 1101101110110110
I am interested in determining the status of the bold bit.
If I take the number 56246 that is stored in my database and CONVERT it to binary, I seem to get a HEX value.
DELCARE @i int, @b binary(16)
SET @i = 56246
SET @b = CONVERT(binary(16), @i)
PRINT @b
I have no idea how to decide if the bit I want to check is a 1 or 0.
Any help would be most appreciated!