SQLTeam.com | Weblogs | Forums

How to convert the Binary value to XML Format


#1

Hi,

I have stored the binary value in Table Document with Image datatype

Document(Image, notnull)

i tried to reterive the binary value to XML format.

Query:
Select convert (xml, "0x504B0304140000000800000000001F267CB31201000018030000130000005B436F6E74656E745F54797065735D2E786D6CAD924D4FC3300C86FF4A942B6AD271")

but this is not wroking, it return the same binary value. Could you please correct the query .

Thanks


#2

select image
from table
for xml path('')


#3

Looking at the data, I can tell it's compressed with PKZIP. You will have to uncompress the content before converting it into XML.