[英]Informatica: downloading image data type to disk
I have a table in sql server that contain two columns 我在sql server中有一个包含两列的表
Filename char datatype
File image datatype
Requirement is to download all the data to the disk , is it possible using informatica and if yes how? 要求将所有数据下载到磁盘上,是否可以使用informatica?
For example, if there are two rows in the table: 例如,如果表中有两行:
sal_1.pdf, <<image data>>
sal_2.pdf, <<image data>>
and it needs to be pushed to disk D:/file_dump
directory then D:/file_dump
should have two files with the names sal_1.pdf
and sal2.pdf
. 并且需要将其推入磁盘
D:/file_dump
目录,然后D:/file_dump
应该有两个文件,名称分别为sal_1.pdf
和sal2.pdf
。
You could use T-SQL
and bcp
( link 1 , link 2 ) like this: 您可以像这样使用
T-SQL
和bcp
( 链接1 , 链接2 ):
1) Write a T-SQL script (using SQL Server Management Studio) to generate all shell/bcp commands 1)编写一个T-SQL脚本(使用SQL Server Management Studio)以生成所有shell / bcp命令
SET NOCOUNT ON;
SELECT 'bcp "SELECT y.File FROM Schema.Table y WHERE y.IDColumn='
+ CONVERT(VARCHAR(11),x.IDColumn)
+ ' queryout "D:\file_dump\'
+ x.FileName
+ '" -N -S SqlServerInstance -T -d "DatabaseName"'
FROM Table x
Press Ctrl+T
(Text results) 按
Ctrl+T
(文本结果)
Press F5
(Execute) 按
F5
(执行)
Press F6
(It activates the Results (text)
panel 按
F6
(它将激活“ Results (text)
面板
Press Ctrl+A
(Select All) 按
Ctrl+A
(全选)
Press Ctrl+C
(Copy) 按
Ctrl+C
(复制)
2) Create a new text file ( Win Key
+ Notepad
+ Enter
), Ctrl+V
(Paste), Save As ...
-> dump_pdf.bat
2)创建一个新的文本文件(
Win Key
+ Notepad
+ Enter
), Ctrl+V
(粘贴), Save As ...
> dump_pdf.bat
3) Execute dump_pdf.bat
file 3)执行
dump_pdf.bat
文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.