如何仅从 SSIS 中的平面文件中检索前 x 行 [英] How do I retrieve only the top x rows from a flatfile in SSIS

查看:32
本文介绍了如何仅从 SSIS 中的平面文件中检索前 x 行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个平面文件连接,我只对前 10 行数据感兴趣.如何只导入前 10 行?行采样是随机的,所以我不能使用它.有什么方法可以让我拥有某种派生列,它是自动行号或其他东西,然后数据拆分以仅保留具有该 ID <= 10 的行?

I have a flatfile connection and I'm only interested in the first 10 rows of data. How can I just import the first 10 rows? Row sampling is random so I can't use that. Is there some way I can have some sort of derived column which is an automatic row number or something and then data-split to only keep rows with that id <= 10?

非常感谢任何帮助!

推荐答案

我用过这个组件 --> http://www.sqlis.com/post/Row-Number-Transformation.aspx

I've used this component --> http://www.sqlis.com/post/Row-Number-Transformation.aspx

该组件创建一个带有行号的新变量.您可以使用条件拆分根据组件创建的变量获取前 10 条记录.

The component creates a new variable with a row number. You can use a conditional split to take the first 10 records based on the variable the component creates.

一个问题是您需要读取整个文件.根据您的文件大小,您可能需要寻求其他解决方案.

One catch is that you will need to read in the entire file. Depending on your file size you may want to seek another solution.

这篇关于如何仅从 SSIS 中的平面文件中检索前 x 行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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