开发者

Export image data to flat file

I'm trying to export my image data from a table to a flat file using "Export Data" wizard. I've specified the query "Select picture from Profile", in SSIS to export only the data in "picture" coloumn. When 开发者_如何学PythonI run the package, I get the following error:

The data type for "input column "picture" (26)" is DT_IMAGE, which is not supported. Use DT_TEXT or DT_NTEXT instead and convert the data from, or to, DT_IMAGE using the data conversion component.

How can I export the data to flat file

Thanks in advance.


I stumbled in here from google and spent a few hours trying to find the answer. Here is what I did, assuming the column you are trying to export is 'SomeImageField':

SELECT CONVERT(varchar(max),CONVERT(varbinary(max),[SomeImageField]),2) AS SomeImageFieldAsHex FROM SomeTable;

This will output that column into a column named SomeImageFieldAsHex. It will be formatted as hexadecimal text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜