[英]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.
我在SSIS中指定了查询“从配置文件中选择图片”,只导出“picture”列中的数据。 When I run the package, I get the following error:
当我运行包时,我收到以下错误:
The data type for "input column "picture" (26)" is DT_IMAGE, which is not supported.
“输入列”图片“(26)”的数据类型是DT_IMAGE,不受支持。 Use DT_TEXT or DT_NTEXT instead and convert the data from, or to, DT_IMAGE using the data conversion component.
请改用DT_TEXT或DT_NTEXT,并使用数据转换组件将数据转换为DT_IMAGE或转换为DT_IMAGE。
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':
这是我做的,假设您要导出的列是'SomeImageField':
SELECT CONVERT(varchar(max),CONVERT(varbinary(max),[SomeImageField]),2) AS SomeImageFieldAsHex FROM SomeTable;
This will output that column into a column named SomeImageFieldAsHex. 这会将该列输出到名为SomeImageFieldAsHex的列中。 It will be formatted as hexadecimal text.
它将被格式化为十六进制文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.