Show all Hide all


Converts binary data to hex-string representation.

Type: Scalar function
Area of use: General use

Return value: varchar(8000)

The hex-string representation of the data.


@binin mandatory varbinary(8000)
Data to convert.
@startoffset optional int
The offset to start conversion from. The default value is 1, which is the first position in the data.
@nobytes optional int
The number of bytes to convert or zero to convert everything.

NOTE: The number of bytes to convert may not exceed 4000 to fit into a varchar(8000) since every byte requires two characters in hex notation.
The default value is 0, which means the entire data set should be converted.