[英]With SSIS, how do you export SQL results to multiple CSV files?
In my SSIS package, I have an Execute SQL Task that is supposed to return up to one hundred million (100,000,000) rows.在我的 SSIS package 中,我有一个执行 SQL 任务,它应该返回多达一亿(100,0000)行。
I would like to export these results to multiple CSV files, where each file has a maximum of 500,000 rows.我想将这些结果导出到多个 CSV 文件,其中每个文件最多有 500,000 行。 So if the SQL task generates 100,000,000 results, I would like to produce 200 csv files with 500,000 records in each.因此,如果 SQL 任务生成 100,000,000 个结果,我想生成 200 个 csv 文件,每个文件有 500,000 条记录。
What are the best SSIS tasks that can automatically partition the results into many exported CSV files?什么是最好的 SSIS 任务,可以自动将结果分割成许多导出的 CSV 文件?
I am currently developing a script task but find that it's not very performant.我目前正在开发一个脚本任务,但发现它的性能不是很好。 I am a bit new to SSIS so I am not familiar with all the different tasks available, and I'm wondering if maybe there's another one that can do it much more efficiently.我对 SSIS 有点陌生,所以我不熟悉所有可用的不同任务,我想知道是否还有另一个可以更有效地完成它。
Any recommendations?有什么建议吗?
First add a dataflow task.首先添加一个数据流任务。
In the dataflow task add the following:在数据流任务中添加以下内容:
In the conditional split you can add multiple conditions to split out your data and have a default output.在条件拆分中,您可以添加多个条件来拆分数据并具有默认的 output。
Flat file connection manager:平面文件连接管理器:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.