I have been banging my head against a wall on this. I am trying to get data from a field in a SQL Server database that has a type of varbinary(28)
.
I just can't work out how to convert the data from hex back to chars.
I know that a column = '1081X' and the hex stored in the database is 0x7E959C9ABB818C
.
I have tried:
SELECT
0x7E959C9ABB818C, '1081X',
CONVERT(VARBINARY(28), '1081X'),
CONVERT(VARBINARY(28), N'1081X')
-- 0x7E959C9ABB818C 1081X 0x3130383158 0x31003000380031005800
Any ideas on how to retrieve '1081X' from the code 0x7E959C9ABB818C ?