Posted by Chris.Cheney on 05/01/07 19:52
tfeller <ToddFeller@gmail.com> wrote in news:1178044017.983887.201130
@o5g2000hsb.googlegroups.com:
> I would like to drop the leading 0x on a binary value so I can do a
> bitwise operation.
>
> Here is simplified code:
>
> select right(0x88186000,8)
>
> I expected to get back 88186000, this was not the case. The command
> returned some wierd characters.
>
> Am I missing something?
>
What do you get back from SELECT 0x88186000 ?
I don't expect it will be 0x88186000
Try SELECT CAST(0x41424344 as varchar) and you should get back ABCD
The _representation_ (note emphasis) of a binary value _in T-SQL_ is a
sequence of characters that begin with 0x - but the 0x does not form part
of the _actual binary value_, any more than the starting and ending quotes
form part of a character value.
Navigation:
[Reply to this message]
|