Does anybody know how to view the contents of fields containing binary data in an MS SQL Server 2005 database?
-
If the data is binary... how would you "view" it?ahockley– ahockley2009-02-10 15:34:34 +00:00Commented Feb 10, 2009 at 15:34
-
It may be a string in which case viewing it in ascii or hex form would suffice. At the moment all I see is <Binary data>.Xandir– Xandir2009-02-10 15:36:44 +00:00Commented Feb 10, 2009 at 15:36
-
use a query not the open table wizard, see my answer belowSQLMenace– SQLMenace2009-02-10 15:50:38 +00:00Commented Feb 10, 2009 at 15:50
Add a comment
|
1 Answer
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
1 Comment
Xandir
Thanks. I was hoping for a utility to take some of the legwork out of it but this is a workable solution.