• Just a reminder that in SQL Server 2008 onwards you can use the following to represent a binary value as a character string (rather than a CTE or sp_hexadecimal):

    SELECT CONVERT(VARCHAR(12), 0x68656c6c6f, 1)

    --0x68656C6C6F

    Chris