Link to home
Start Free TrialLog in
Avatar of n0ch1ps
n0ch1psFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of sajuks
sajuks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
do you need 0x4E4E to read 'NN' or '0x4E4E' ?
Avatar of n0ch1ps

ASKER

I'd need '0x000174F400004FF6000E00000000' to read '0x000174F400004FF6000E00000000'

cheers

Then you can use the system function fn_varbintohexstr

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

select master.dbo.fn_varbintohexstr(@a)
Avatar of sajuks
sajuks

then check the accepted answer in the link i posted by p_puranik
Oops please ignore my post above (same solution than sajuks's post)
My apologies sajuks
Hilaire no apology needed...i wasnt sure what o/p was to be shown and posted what am currently using.