locked
How to merge data from multiple data source RRS feed

  • Question

  • Hi!

     

    I have three flat files and I  want to load only certain column from those three files into one sql server table. HOw can I do that?

    e.g.,

    I have three flat files like orders, Customers, Contact. There are many columns in those three files but I am only interested in orderid from Orders, Custid form Customers and Address from Contact. And I want to load data of those columns only into one table. How can I do that in SSIS? 

     

    THanks.

     

    Thursday, June 24, 2010 7:54 PM

Answers

  • Sounds like you are de-normalizing data from 3 flat files and loading into SQL, yes?

    In that case, create 3 Flat file sources on your Data FLow, one for each file. Use a Merge Join to bring together Orders with Customers, assuming each contains a common field like CustomerID. NOTE that you will need to SORT each stream BEFORE the Merge Join, and sort on the column that will be used to join.

    From there, send to another Merge Join that pulls in Contact info (sorted by Customer ID agian).

    With each Merge Join operation, you can decide which column you want from each input that will be in the Output.


    Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
    • Proposed as answer by Todd McDermid Thursday, June 24, 2010 9:24 PM
    • Marked as answer by Terri Chen Friday, June 25, 2010 7:35 AM
    Thursday, June 24, 2010 8:03 PM