From: Roy Goldhammer on
Hello there

I have table with bigint values.

I need to convert them to string as hex

for example: 209 = C9

when i do select convert(binary(3), 209)

it set on screen 0x0000C9 which is what i want.

but when i try to enter it to string it set an empty string.

Is there a way to enter "0000C9" to string?


From: Plamen Ratchev on
Here are two methods:
http://blogs.msdn.com/b/sqltips/archive/2008/07/02/converting-from-hex-string-to-varbinary-and-vice-versa.aspx

--
Plamen Ratchev
http://www.SQLStudio.com
From: Gene Wirchenko on
On Tue, 27 Jul 2010 17:40:55 +0300, "Roy Goldhammer" <royg(a)yahoo.com>
wrote:

>Hello there
>
>I have table with bigint values.
>
>I need to convert them to string as hex
>
>for example: 209 = C9

I hope this is not a test case. 209 = D1 and C9 = 201.

>when i do select convert(binary(3), 209)
>
>it set on screen 0x0000C9 which is what i want.
>
>but when i try to enter it to string it set an empty string.
>
>Is there a way to enter "0000C9" to string?

Sincerely,

Gene Wirchenko