Varbinary to Varchar

I realise this question has no doubt been asked and answered many times, however I'm asking it anyway.

I need to convert a varbinary data type to Varchar so the results are viewable to certain applications we run that cannot read binary.

Many thanks
LVL 5
n0ch1psAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sajuksCommented:
Check http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21325062.html
 DECLARE @X varbinary(20)
Set @X = CAST('Experts Exchange' As varbinary(20))
Select @X As [varbinary], CAST(@X as varchar(20)) As [varchar]

This gives me the following result:
varbinary                                  varchar              
------------------------------------------ --------------------
0x457870657274732045786368616E6765         Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HilaireCommented:
do you need 0x4E4E to read 'NN' or '0x4E4E' ?
n0ch1psAuthor Commented:
I'd need '0x000174F400004FF6000E00000000' to read '0x000174F400004FF6000E00000000'

cheers

Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

HilaireCommented:
Then you can use the system function fn_varbintohexstr

declare @a varbinary(200)
set @a = 0x00FF00FF

select master.dbo.fn_varbintohexstr(@a)
sajuksCommented:
then check the accepted answer in the link i posted by p_puranik
HilaireCommented:
Oops please ignore my post above (same solution than sajuks's post)
My apologies sajuks
sajuksCommented:
Hilaire no apology needed...i wasnt sure what o/p was to be shown and posted what am currently using.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.