SSIS - 我只需要从平面文件导入第一行。最好的方法是什么?
我有一个文件,其中第一行包含标题记录,我只需要评估该行。其余行是详细记录。我现在将其设置为条件拆分中的平面文件源组件。条件分割的工作是查找字符串“header”,然后读取下一列以获取计数。我发送标头记录并丢弃其余部分。
这工作正常,但对于我的较大文件(300k-800k 行,100MB-900MB),我必须等待条件分割来评估所有 300k 行,这需要时间。
有更好的方法吗?我想我可以使用脚本组件并在第一行之后中断,但我想在编写脚本之前看看是否有内置解决方案。
想知道是否有人知道替代方案。
I have a file that contains a header record in the 1st row, and I need to evaluate only that one row. The rest of the rows are detail records. I have it set up now as a flat file source component into a conditional split. The job of the conditional split is to look for the string "header" and then read the next column to get the count. I send the header record on and discard the rest.
This works fine, but for my bigger files (300k-800k rows, 100MB-900MB) I have to wait for the conditional split to evaluate all 300k rows, and this takes time.
Is there a better approach? I guess I could use a script component and break after the 1st row, but I'd like to see if there's a built in solution before I script it up.
Wondering if anyone knows of an alternative.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
寻找脚本组件。这是此任务最简单的解决方案。
Go for the script component. This is the simplest solution for this task.