I have to insert data into two tables from two different excel sheets using SSIS packges.
So, please some one tell me How to import multiple Excel files into SQL Server 2008 R2 using SSIS Packages?
since you have only 2 excel files and only two tables I don't see why use a foreach loop. Just follow this link and do it directly
If you need to insert from both excel files to both databases you can use a multicast component to create a copy of a dataset
Use Foreach Loop Container --> Foreach File Enumerator. Then put your Data Flow in Foreach Loop Container. Table structure and sheet name have to be equal in every Excel file.
Here is nice tutorial: http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With