[posted and mailed, please reply in news]
Supratim (su******@sagemetrics.com) writes:
I want to get the string representation of a hex number from a
varBinary column of a table.
For example I want to get the output : 'The Hex value is 0xFF'
but
select 'The Hex value is ' + convert(varchar(10), 0xFF)
retruns the ascii charecter for 0xFF
Any idea how do I get the hex form as it is?
You can use
select master.dbo.fn_varbintohexstr(@binvalue)
Note, however, that fn_varbintohexstr is un documented function, and thus
unsupported.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp