Skip to content Skip to sidebar Skip to footer

Show Hexadecimal Dump Of String

Is there any way to obtain an hexadecimal dump of a string in SQL Server? It'd be useful to troubleshoot character set and collation issues. In MySQL you'd do SELECT HEX('€uro')

Solution 1:

SELECTCAST('€uro'ASVARBINARY(4))

Returns

  0x8075726F

On my default collation.

Edit. Just noticed the Unicode tag

SELECTCAST(N'€uro'ASVARBINARY(8))

Returns

 0xAC20750072006F00

Post a Comment for "Show Hexadecimal Dump Of String"