Skip to main content
Version: 0.0.1

UNHEX

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

{{< codeheader "UNHEX example" >}}

SELECT UNHEX('4472656D696F')
-- RHJlbWlv

Usage Notes

The returned value is a binary string. If the expression contains non-hex characters the result is NULL.