Re: logical and

From: Frank (frank_at_frank.com)
Date: 01/12/05


Date: Wed, 12 Jan 2005 15:01:40 +0100

GREAT!!!!!
Frank
"Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> schreef in bericht
news:uaWOg4K%23EHA.1296@TK2MSFTNGP10.phx.gbl...
> The bitwise AND logical operator in SQL Server is '&'. This expects
> integer values. Converting your binary values to integer:
>
> IF 8 & 193 = 193 PRINT 'true' ELSE PRINT 'false'
> IF 170 & 2 = 2 PRINT 'true' ELSE PRINT 'false'
>
> See Bitwize AND in the Books Online for more information.
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>
> "Frank" <frank@frank.com> wrote in message
> news:41e50fbc$0$6211$e4fe514c@news.xs4all.nl...
>> Hi,
>> I want to do a logical comparison between two tinyint-columns in a select
>> statement.
>> With logical I mean: if a bit in the tinyints are both 1 then comparison
>> is true.
>> 00001000 and 11000001 = false
>> 10101010 and 00000010=true
>>
>> Can this be done in SQLServer?
>> Thanks
>> Frank
>>
>>
>
>



Relevant Pages

  • Re: VB6 SQL Server
    ... >Our main problem, besides database size, is the SLOW process of inserting ... I don't see that converting to SQL Server would fix that. ... Check to see if your DAO is use fast, ...
    (microsoft.public.vb.database)
  • RefreshLink error - 3078
    ... I'm in the process of converting an Access 97 backend to SQL Server 2005; ... I'm ready to link the backend data. ... I've created the DSN and started the linking process and get an error stating: ...
    (microsoft.public.access.conversion)
  • Re: Any valid login can access Enterprise Manager
    ... "Dan Guzman" wrote: ... It's possible to revoke public permissions ... permissions, not SQL Server security. ... When creating a SQL Server2000 login with read-only rights ...
    (microsoft.public.sqlserver.security)
  • Re: Maximum number of parameters for a procedure
    ... If this is about a stored procedure, then you are limited by what SQL Server ... > I'm in the process of converting apps to dot net from vb 6 and this one is ... >>> Leroy ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Transform Data Task and bit data type
    ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... "Ajit" wrote in message ... How about converting to integer or string first? ...
    (microsoft.public.sqlserver.dts)