How do I read Top 10 records from Flat File Source in SSIS Package?

Ramana Kopparapu 306 Reputation points
2023-08-29T15:54:38.6866667+00:00

I have Flat File with 17 rows with id, name header rows. How can we create SSIS Package to read first 10 rows from the Flat File Source using RowCount Transformation?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 26,586 Reputation points
    2023-08-29T19:58:45.8933333+00:00

    Hi @Ramana Kopparapu,

    You can try to use Bulk Insert Task.

    That task has LastRow setting so you can specify to read first 10 rows from the source file.

    For the reference: https://www.tutorialgateway.org/bulk-insert-task-in-ssis/

    0 comments No comments

  2. ZoeHui-MSFT 41,491 Reputation points
    2023-08-30T02:01:01.1033333+00:00

    Hi @Ramana Kopparapu,

    You may use Script component as transformation to generate the sequence number for each of the record. Once we have the sequence number we will be using Conditional Split to get top X records or range of rows depending upon our requirement. 

    Here is a tutorial you may take a reference to.

    SSIS - Read Top X Rows From Flat File / Excel File OR Range OF Rows

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.