SSIS:创建一个包,用于根据记录Count动态创建多个csv文件 [英] SSIS:Create a package for dynamically create multiple csv files based on records Count

查看:124
本文介绍了SSIS:创建一个包,用于根据记录Count动态创建多个csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助!!。



要求

我有一个StoredProc它会返回1000万条记录。在这种情况下,它可以增加/减少1000万条记录。



因此在这种情况下,我们需要为多个csv文件创建一个SSIS包。



在这个Ex。如果10Million Records中有10个csv文件,每个文件应创建100万个记录



如下所示,它工作正常,但需要更多时间。



步骤:

--------

1.脚本任务:用于生成带有日期和时间的文件夹路径

2.file系统任务:根据脚本任务文件路径创建文件夹(如果不存在)。

3.数据流任务

a.Flat文件来源设置

b.Script组件:这里我使用SP返回基于的结果结果,我将主结果表拆分为10个表(每个表包含1百万条记录)并循环遍历10个表。

c。在该循环中,我们基于该表创建csv文件。



按预期工作但它很长时间来创建10个csv文件。所以想检查是否有任何其他情况。请帮忙。





谢谢,

Murali

Help required!!.

Requirement
I have a StoredProc it returns the 10 Million records. In this case 10 Million records it may increase/decrease..

So in this scenario,we need create a SSIS Package for multiple csv files.

In this Ex .if 10Million Records then 10 csv files, each file should create with 1 million records

done as below, its working fine but taking more time.

steps:
--------
1. Script Task: is used to generate the Folder path with date and time
2.file system Task:Create Folder if Doesn't Exists based on script task file path.
3.Data Flow Task
a.Flat File Source to be set it up
b.Script Component:here i am using SP to return the results based on results, i am splitting the main result table to 10 tables(each table contains 1million records) and looping through the 10 tables.
c.In that loop we are creating the csv file based on that table.

Working as expected but its very long time to create 10 csv files .so wanted to check if any other scenario's. Please help on this.


Thanks,
Murali

推荐答案

您必须使用for循环容器来创建多个CSV文件。



请查看以下链接 - http://stackoverflow.com/questions/7352104/create-multiple-flat-file-from-running-same-query-具有不同标准 [ ^ ]
you have to use for loop container for creating multiple CSV files.

Please check below link - http://stackoverflow.com/questions/7352104/create-multiple-flat-file-from-running-same-query-with-different-criteria[^]


请找到以下链接以获得完美的解决方案。



http://social.technet.microsoft.com/wiki/contents/articles/3172.split-a-flat-text-file-into-multiple-flat-text-files-using-ssis .aspx [ ^ ]





这里主要缺点是OLEDB源根据结果计数执行



Ex:SP返回1000万条记录,我们的分割计数值为1百万,然后是此SP的10倍Excutes并处理10 csv输出文件。
Please find the below link to get the solution perfectly.

http://social.technet.microsoft.com/wiki/contents/articles/3172.split-a-flat-text-file-into-multiple-flat-text-files-using-ssis.aspx[^]


And here major drawback is OLEDB source executes based on result count

for Ex: SP returns 10million Records and our splitting count value is 1million then 10 times this SP Excutes and process the 10 csv output files.


这篇关于SSIS:创建一个包,用于根据记录Count动态创建多个csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆