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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need help with cast statement

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2012-07-05 : 14:57:59
what does this here mean? I have to translate to Oracle.


"AND CAST(FLAGS AS BIGINT) & 1 = 1 "

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-07-05 : 15:02:50
The Column Flags is converted to BIGINT and then there a "bitwise AND" performed with 1

http://msdn.microsoft.com/en-us/library/ms174965


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-05 : 15:05:04
its checking if leftmost bit of FLAGS is set & represents bitwise AND operation

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-07-05 : 15:17:30
quote:
Originally posted by visakh16

its checking if leftmost bit of FLAGS is set & represents bitwise AND operation

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




I believe it is the rightmost bit - if not then please enlighten me.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-05 : 15:18:48
quote:
Originally posted by webfred

quote:
Originally posted by visakh16

its checking if leftmost bit of FLAGS is set & represents bitwise AND operation

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




I believe it is the rightmost bit - if not then please enlighten me.


No, you're never too old to Yak'n'Roll if you're too young to die.


sorry my bad
its rightmost bit
time for a coffee i guess

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -