views:

44

answers:

2

How to convert a column value from varbinary(max) to varchar to read..

A: 

Try this

SELECT CONVERT(varchar(5000), yourvarbincolumn, 0)
dmajkic
+1  A: 

Can you just cast it? This works for me.

declare @b varbinary(max)
set @b = 0x5468697320697320612074657374

select cast(@b as varchar(max)) /*Returns "This is a test"*/
Martin Smith