Hex Conversion
I am using SQL 2000 and have a query about hex conversion.
I have a int datatype which I need to convert to hex and store the result as a char.
I have been playing with casting the decimal type to Binary which works fine, however I can't then get what is displayed into a char field as the conversion from binary to char seems to be using the ascii chars to display the string.
For example:
SELECT CAST(379 AS VARBINARY)
returns:
0x0000017B
However, converting this to a Char field returns an empty string:
SELECT CAST(CAST(379 AS VARBINARY) AS VARCHAR)
returns
(1 row(s) affected)
Can anyone help?
Many thanks,
-Graham

