I am working on a SQL Server 2000 migration and I need to convert Image data to plain text. Can any one help me out if any function exits for the same.
What data is in the IMAGE column, exactly? Is it binary data that you need to represent in order to be able to insert it?
If so, you want to use CONVERT with a style code:
Converting from image data type in SQL 2000 can be done via binary / varbinary data types.
The following is a bit messy, but it works. Or at least seems to work in my limited testing...
create table testimg (id integer, imgdata image) insert into testimg values (1, cast ('Test row 1' as image)) insert into testimg values (2, cast ('A longer line of test data' as image)) select id, imgdata, cast(cast(imgdata as binary) as varchar(1000)) FROM testimg
This'll return a varchar(1000) field containing the text version of what's stored in the field named imgdata.
2 People are following this question.