SSIS - 在处理之前从平面文件或 Excel 文件中读取单个标头记录
有没有一种方法可以只读取文件的第一条记录,即读取头信息,以便可以决定是否处理文件的其余部分?
我知道,使用分割转换组件,可以编写一个表达式,该表达式将根据标题中的关键字忽略除标题之外的所有行。 我宁愿不走这条路,因为这样读取文件中的每条记录效率低下。
具体来说,是否有我可以实现的脚本组件逻辑来关闭文件 并在读取第一条记录后结束数据流?
Is there a method by which one can read just the first record of a file, i.e., to read header information so that a decision can be made whther or not to process the remainder of the file?
I know that with the split transformation component one can write an expression that will ignore all of the rows besides the header based on a key word in the header. I would rather not go that route as that is inefficiently reading every record in the file.
Specifically, is there script component logic that I can implement to close the file
and end the dataflow after the first record has been read?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅这篇文章 来自托德·麦克德米德:
See this post from Todd McDermid: