Speaking in Code

Monday, February 02, 2009

How to Convert Image to VarChar(Max)

You can use the CAST to convert the image column to varbinary, binary or timestamp. From those you can convert to nvarchar. You can read only the binary values stored in the image column.

SELECT CAST(CAST (urImageColumn AS varbinary) AS varchar(max)) FROM urTble

(this answer was found in Expert's Exchange)

The VarChar(Max) field will contain binary data. If I find a way to convert it to readable text, I'll update this post.

0 Comments:

Post a Comment

<< Home