From: WCM on
Sql server 2005:

Is there a simple way to translate binary to string and vice versa?

Example:
011001100110111101101111 = 'foo'
'foo' = 011001100110111101101111

Thanks in advance ...!

Bill
From: --CELKO-- on
>> Is there a simple way to translate binary to string and vice versa? <<

Table lookup.
From: Dan on

"WCM" <WCM(a)discussions.microsoft.com> wrote in message
news:E6471C22-3117-41D9-ABA2-BC95CFD9D549(a)microsoft.com...
> Sql server 2005:
>
> Is there a simple way to translate binary to string and vice versa?
>
> Example:
> 011001100110111101101111 = 'foo'
> 'foo' = 011001100110111101101111
>
> Thanks in advance ...!
>
> Bill

You might be able to use the function detailed here to help:
http://support.microsoft.com/kb/104829

What you do is to convert the binary to a hex string, and then you can
convert the hex string to a string using CAST or CONVERT.

So, for instance, the output of the function would be

0x666F6F

If you then use CAST to take that as a hex data type, you will get 'foo' as
the result

select cast(0x666F6F as varchar(255))

result:
foo

--
Dan