Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dcwebman
Starting Member
11 Posts |
Posted - 2005-08-19 : 12:22:41
|
| We are using MS SQL 2000 and came across a limitation. Apparently a bitwise & comparison can only use up to Int. Trying it with a larger number fails. For example:declare @FieldMask bigintset @FieldMask = 4294967296select 4294967296 & @FieldMaskOr trying this too:declare @FieldMask bigint, @FieldMask2 bitintset @FieldMask = 4294967296set @FieldMask2 = 4294967296select @FieldMask2 & @FieldMaskIs there any way to use a bigint value with the & comparison?Thanks,Jeff |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-19 : 13:46:06
|
Hi dcwebman, Welcome to SQL Team!From BoL it looks like there aren't any bitwise operators on BigIntsquote: & (Bitwise AND)Performs a bitwise logical AND operation between two integer values.Syntaxexpression & expressionArgumentsexpressionIs any valid Microsoft® SQL Server™ expression of any of the data types of the integer data type category. expression is an integer parameter that is treated and transformed into a binary number for the bitwise operation.
Kristen |
 |
|
|
VladRUS.ca
Starting Member
23 Posts |
Posted - 2005-08-19 : 13:51:34
|
| @FieldMask2 bitint ??? Try this code (works fine for me):==================================declare @FieldMask bigint, @FieldMask2 bigintset @FieldMask = 4294967296set @FieldMask2 = 4294967296select @FieldMask2 & @FieldMaskOR declare @FieldMask bigint, @FieldMask2 bigintset @FieldMask = 9223372036854775807set @FieldMask2 = 9223372036854775807select @FieldMask2 & @FieldMask |
 |
|
|
dcwebman
Starting Member
11 Posts |
Posted - 2005-08-24 : 10:40:56
|
| Typo, sorry. So I guess it comes down to having to create another field for continued masking. Thanks for the reply. |
 |
|
|
|
|
|