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?
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?
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
You can create and use variables to hold Excel file path, then implement the package within a for-each-loop container to loop trough each excel files in the folder. Make sure that the files are having similar data format and same extension. Create an integration service project in Visual Studio and follow the steps below:
Right Click on canvas and add Variable say "FilePath" and set type as String
Drag a for-each loop to canvas
Ref: https://www.encorebusiness.com/blog/import-data-from-multiple-excel-files-sql-ssis/
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