[英]Import Multiple Excel files into a table using SSIS
I have two Excel files named 'First' and 'Second' in same location . 我在同一位置有两个名为“ First”和“ Second”的Excel文件。
They have same schema. 它们具有相同的架构。
I used foreach loop counter and put Data flow task into it. 我使用了foreach循环计数器,并将数据流任务放入其中。
The data flow diagram looks like this:- 数据流程图如下所示:-
Here, I selected first excel file as the source.... 在这里,我选择了第一个excel文件作为源。
My For Each Loop Container Editor:- 我的每个循环容器编辑器:
After running the SSIS package successfully the output came like this:- 成功运行SSIS包后,输出如下:-
Which took data only from First excel file and three times,I must have done something wrong in there,But I cant figure it out. 该文件仅从First excel文件中获取了数据,并且有3次,我肯定在那里做错了,但是我无法弄清楚。
Check your Foreach Loop Editor: 检查您的Foreach循环编辑器:
Collection>Folder
Collection>Files
Your file should not have a particular file name, for multiple excel use *.xlsx
. 您的文件不应具有特定的文件名,因为多个excel请使用
*.xlsx
。
Edit: 编辑:
Use a Script task to Debug. 使用脚本任务进行调试。 Map the value of ForEach to a variable and display it through Script task.
将ForEach的值映射到变量,然后通过脚本任务显示它。 Edit the script task with below code.
使用以下代码编辑脚本任务。
MessageBox.Show(Dts.Variables["Variable"].Value.ToString());
Also, Please check your Source Excel connetion is configured correctly with values coming from foreach. 另外,请检查您的Source Excel connetion是否正确配置了来自foreach的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.