Question

What's the most efficient way to convert the output of this function from a varbinary() to a a varchar()?

Was it helpful?

Solution

How about this:

master.sys.fn_varbintohexstr(@binvalue)

OTHER TIPS

For SQL Server 2008 use

CONVERT(varchar, @binary, 1)

1 - style 0x060D, 2 - 060D

http://msdn.microsoft.com/en-gb/library/ms187928.aspx

CONVERT(varchar, @binary)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top