Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 PLEASE HELP ME WITH EXCEL IMPORTS

Author  Topic 

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-05 : 11:58:42
I really really need help with this. I've been stuck on the same issue for days now.

Basically i have 6 excel files which i need to loop through.
Each excel file has 1 sheet each but the sheet names are different.
EG: Sheet1, Sheet2, IRE, ....

I need to be able to loop through all these 6 files and read the data of these sheets and insert into 1 table.

I am able to loop through if the sheet names are the same, but not when the sheet name changes.

I am loading the data into 1 sql server table.


sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-06 : 08:17:19
Somebody please help me. How do i loop around Excel files and insert the data into sql table.

if i set the table and view in the datasource to variable it errors. I need help.
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-06 : 09:53:21
So far i have got it to work using the following link
http://msdn.microsoft.com/en-us/library/ms345182.aspx

but i have a problem when some of the sheet names are different. It doesnt load those files. How do i fix this
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-07 : 14:05:04
http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-09 : 07:55:07
This works on looping thorugh files, but if the sheet name is different, then it doesnt work?
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-09 : 13:50:36
I really really need help with this. I've been stuck on the same issue for days now.

Basically i have 6 excel files which i need to loop through.
Each excel file has 1 sheet each but the sheet names are different.
EG: Sheet1, Sheet2, IRE, ....

I need to be able to loop through all these 6 files and read the data of these sheets and insert into 1 table.

I am able to loop through if the sheet names are the same, but not when the sheet name changes.

I am loading the data into 1 sql server table.
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-09 : 15:16:22
Solution found. A loop with in a loop solved this problem
Go to Top of Page
   

- Advertisement -