Wednesday, March 21, 2012

Image Data Type

How do I extract the text or readable data from a column
that is defined as an image data type?Is the READTEXT supposed to return Hex values?
select ImageData from afw_image where imageid = '1998-02-
11 12:49:30.283'
GO
DECLARE @.ptrval varbinary(16)
SELECT @.ptrval = TEXTPTR(ImageData)
FROM afw_image
WHERE imageid = '1998-02-11 12:49:30.283'
READTEXT afw_image.ImageData @.ptrval 1 25
GO
ImageData
---
---
---
---
--
0x204D41494C494E472041444452455353204348414E474520393630343
232204546464543544956452030342F31352F393620504C454153452020
20200D0A495353554520414E20454E444F5253454D454E5420574954482
05448452020464F4C4C4F57494E47204348414E4745533A202020504C45
41534520200D0A414D45
(1 row(s) affected)
ImageData
---
---
---
---
--
0x4D41494C494E472041444452455353204348414E4745203936
(1 row(s) affected)
>--Original Message--
>Dave,
>Refer READTEXT in BooksOnLine.
>--
>Dinesh.
>SQL Server FAQ at
>http://www.tkdinesh.com
>"Dave M" <dmunsterman@.appliedsystems.com> wrote in message
>news:8f5a01c35b6f$64f3e9b0$a001280a@.phx.gbl...
>> How do I extract the text or readable data from a column
>> that is defined as an image data type?
>
>.
>

No comments:

Post a Comment