Lookup File

Winston TheFifth 101 Reputation points
2022-01-27T21:50:41.963+00:00

I have 2 csv files. FileA has a dataset. FileB only has a list of row numbers in FileA that need to be imported. How do you link the 2 files to get the right rows in FileA?

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

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 33,386 Reputation points
    2022-01-28T01:55:58.637+00:00

    Hi @Winston TheFifth ,

    Here is two resolutions to meet your need.

    First one we could use lookup-transformation.

    Note that the reference dataset can be a cache file or an existing table. The Lookup transformation uses either an OLE DB connection manager or a Cache connection manager to connect to the reference dataset.

    I'd suggest that you may import the reference csv file to SQL Server database via SSIS first.

    And then you may use lookup transformation successfully.

    The second one is that we may use merge-join-transformation.

    Here is a blog which provide the detailed steps.

    ssis-basics-using-the-merge-join-transformation

    Say for example source is FlatFile, and Look up CSV File is FlatFile B.

    After FlatfileSource A have a sort transformation, similarly after FlatFileSource B(CSV File For Look UP) have a sort transformation.

    Sort both the transformation based on the column for which you wanted Look up.

    So you will have two inputs now, one from Sort Transformation A and from sort transformation B. Give these two inputs to Merge Join Transformation. And use inner join Option.

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.