How to read Top 10 records in flat file via SSIS

R.B.V 100 Reputation points
2023-09-26T13:55:37.45+00:00

How to read Top 10 records in flat file via SSIS?

Hope that you may gie the steps.

Thank u in advance.

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

3 answers

Sort by: Most helpful
  1. Olaf Helper 44,501 Reputation points
    2023-09-26T19:06:40.6033333+00:00

    You can't with default setting in data flow/flat file reader.

    Read all and delete afterwards the unwanted records.

    0 comments No comments

  2. Yitzhak Khabinsky 25,856 Reputation points
    2023-09-26T19:37:01.0533333+00:00

    Hi @R.B.V,

    Bulk Insert Task in SSIS' Control Flow supports such functionality via LastRow and FirstRow parameters.

    Here is a tutorial for you: https://www.tutorialgateway.org/bulk-insert-task-in-ssis/

    0 comments No comments

  3. ZoeHui-MSFT 36,511 Reputation points
    2023-09-27T02:29:21.0866667+00:00

    Hi @R.B.V,

    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.