17

Does anybody know how to view the contents of fields containing binary data in an MS SQL Server 2005 database?

bummi
  • 27,123
  • 14
  • 62
  • 101
Xandir
  • 173
  • 1
  • 1
  • 7

1 Answers1

23

Depends if it is just text stored as binary or not, if it is then take a look at this

create table #bla (col1 varbinary(400))

insert #bla values(convert(varbinary(400),'abcdefg'))

select col1,convert(varchar(max),col1)
from #bla

output 0x61626364656667 abcdefg

SQLMenace
  • 132,095
  • 25
  • 206
  • 225
  • Thanks. I was hoping for a utility to take some of the legwork out of it but this is a workable solution. – Xandir Feb 10 '09 at 16:04