对于每个循环容器只运行一次 [英] For each loop container runs only once

查看:126
本文介绍了对于每个循环容器只运行一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个典型的情况。我有一些分隔的平面文件,有10000行要导入SQL DB。所以我构建了一个包含For Each Loop的包,其中包含: -



A.脚本任务 - 清除Flat文件中的所有CLRF(根据业务需求) 。

B.数据流任务

C.文件系统任务。



现在我运行包,如果平面文件包含较小的行,例如50,60,则包对所有文件运行正常。但是,只要我尝试使用10,000行的实际文件,程序包就会成功运行一个文件。它在一个文件后显示执行完成



如果我保留两个较小的文件(50-60行)和两个较大的文件(10000行)包对所有文件运行正常。任何人都可以帮我解决

I have a typical situation. I have certain delimited flat files having 10000 rows to be imported to SQL DB. So I built a package containing with For Each Loop containing:-

A. Script Task- which clears all the CLRF on in the Flat file(as per BUSINESS requirement).
B. Data Flow Task
C. File System Task.

Now when i run the package, if the flat files contains lesser rows say 50,60 the package runs okay for all the files. However as soon as I try with my actual files with 10,000 rows the package runs successfully for one file only. It shows "execution completed" after one file.

Again if i keep two smaller files(50-60 rows) and two bigger files (10000 rows) the package runs fine for all the files. Can any one help me out

推荐答案

实际上我不知道会发生什么。但你可以通过设置一个断点来找到它。我可以帮忙。



1-为处理的行数声明一个变量:

Actually I don't know what happens. But you can find it by putting a break point. I can help in this point.

1- declare a variable for the processed line count:
int lineC=0;





2-在循环中添加if子句,并将断点放在此处。



2- add if clause in the loop, and put the breakpoint here.

while(<condition>) {
  if(lineC==9999) {
    Console.Writeline("i am here"); // <---- break point
  }
  lineC++;
}</condition>





然后你可以轻松追踪发生的事情。



then you can easily trace what happens.


这篇关于对于每个循环容器只运行一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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