Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Importing one file into two database tables Expand / Collapse
Author
Message
Posted Wednesday, January 9, 2013 8:40 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, September 6, 2014 1:45 PM
Points: 112, Visits: 1,481
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


Post #1404835
Posted Wednesday, January 9, 2013 8:46 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1404838
Posted Wednesday, January 9, 2013 8:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 5,316, Visits: 12,346
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.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1404840
Posted Wednesday, January 9, 2013 8:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
Thats one to investigate, never used multicast.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1404842
Posted Thursday, January 10, 2013 3:35 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, September 6, 2014 1:45 PM
Points: 112, Visits: 1,481
Hi

I tried both methods but 0 rows were written to the OLE DB Destination 1 (new table).
Is there something I am missing?
Post #1405314
Posted Thursday, January 10, 2013 3:51 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 5,316, Visits: 12,346
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?



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1405323
Posted Thursday, January 10, 2013 4:22 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, September 6, 2014 1:45 PM
Points: 112, Visits: 1,481
The package has pushed files to the first table but has written 0 files to the second table.
Post #1405336
Posted Thursday, January 10, 2013 4:24 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 5,316, Visits: 12,346
Files?

You mentioned only one in your first post.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1405337
Posted Friday, January 11, 2013 12:25 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 4:12 PM
Points: 758, Visits: 1,031
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.
Post #1406227
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse