tags:

views:

232

answers:

1

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?

Any help much appreciated!

+2  A: 

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

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.

CTKeane

related questions