Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bit functions or operators
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01020290
Message ID:
01020374
Views:
15
Thanks, Sergey



>>I'm looking for a function and/or operator that is similar to VFP's BITTEST() function. I would like to test a particular bit set in an integer field within a Stored Procedure.
>>
>
>Richard,
>
>T-SQL has bitwise operators: &-AND, |-OR and ^-XOR. For example
DECLARE @i int
>SET @i = 6
>IF (@i & 1) > 0
>	PRINT 'Bit 1 set'
>IF (@i & 2) > 0
>	PRINT 'Bit 2 set'
>IF (@i & 4) > 0
>	PRINT 'Bit 3 set'
>
State of Florida, DCF
Previous
Reply
Map
View

Click here to load this message in the networking platform