The title probably makes little sense. I have a varchar that represents a hex value. I need to convert that to an int, then to it's character value. As in
CHAR(CONVERT(int,@myhexnumber))
How do I tell SQL that my varchar is already a varbinary, without converting or casting it? When I do either of those it really converts it into a hex value as if it was an int to start with. For instance if it's '15' or even '0x15', it converts to 0x3135 (or 0x30783135), but I want to convert the hex value '0x15' to integer. The convert function doesn't like it with the "0x" on the front, but is there another way to notate it maybe?
CHAR(CONVERT(int,@myhexnumber))
How do I tell SQL that my varchar is already a varbinary, without converting or casting it? When I do either of those it really converts it into a hex value as if it was an int to start with. For instance if it's '15' or even '0x15', it converts to 0x3135 (or 0x30783135), but I want to convert the hex value '0x15' to integer. The convert function doesn't like it with the "0x" on the front, but is there another way to notate it maybe?