I need to convert an integer value to hexadecimal and then concatenate the returned value with a variable of type varchar. For instance, I have a field called uniqueid of type integer and another called mytext of type varchar(1).
If I select both fields like so:
SELECT *
FROM MyTable
I get the following result:
16884167 A
If I change that to:
SELECT CONVERT(VARBINARY(8), uniqueid), MyText
FROM MyTable
I get the following result:
0x0101A1C7 A
I now need to concatenate those two values with a period between so my result would be:
0x0101A1C7.A
But I cannot find a way to convert the represented hexadecimal value to a concatenatable datatype. All avenues I've tried get me a single character representation of the underlying integer value from an ASCII chart.
Any help would be greatly appreciated.
Mavyak