Categories: Conversion, String, Binary
UNHEX
Converts the hexadecimal number into the bytes represented by a number.
Syntax
UNHEX(expression varchar) → varbinary
- expression: A string containing only hexadecimal digits.
Examples
UNHEX exampleSELECT UNHEX('4472656D696F')
-- RHJlbWlv
Usage Notes
The returned value is a binary string. If the expression contains non-hex characters the result is NULL
.
Was this page helpful?
Glad to hear it! Thank you for your feedback.
Sorry to hear that. Thank you for your feedback.