Importing one file into two database tables

  • I have one flat file that i import into a table using an SSIS package. In BIDS i have a data flow task with Flat File pointing to OLE DB Destination.

    I have another table in Database that i need to import the same file. Is there a way to do this using the same SSIS package, rather than creating another package?

    Thanks

  • Within the same DFT, just drag in another flat file source and another destination and mapp the two.

    So 2 Flat File Sources, pointing to the same Flat File Connection Manager, 1 OLE DB Destination to DB1, 1 OLE DB Destination to DB2.

  • Yes.

    In the data flow, after the data source, add a MULTICAST.

    Connect one MULTICAST output to the existing table and another to the new table.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Thats one to investigate, never used multicast.

  • Hi

    I tried both methods but 0 rows were written to the OLE DB Destination 1 (new table).

    Is there something I am missing?

  • ziako (1/10/2013)


    Hi

    I tried both methods but 0 rows were written to the OLE DB Destination 1 (new table).

    Is there something I am missing?

    Are you saying that it previously wrote many rows, you added a multicast and now it writes zero?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • The package has pushed files to the first table but has written 0 files to the second table.

  • Files?

    You mentioned only one in your first post.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • One possible reason why there are no rows going into the second table is that you have the multicast in the wrong place. The multicast needs to happen before the write to the first table. You can think of it as creating an identical copy of every row that comes into the multicast. Then the two results of the multicast go to the first and the second table (one each).

    Another possible reason why there are no rows being inserted into the second table is that there is something wrong with the insert (permissions or missing fields or incorrect fields or the like). However, you should see errors if that were the case.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply