Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bit functions or operators
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01020290
Message ID:
01020374
Vues:
17
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform