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 12»»

Import Data from Multiple Excel Sheets using SSIS Expand / Collapse
Author
Message
Posted Friday, January 16, 2009 1:43 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Friday, February 28, 2014 6:30 AM
Points: 175, Visits: 150
Hi friends,

Can anyone help me out how to extract data from multiple excel sheets (same excel doc having multiple sheets) using SSIS 2005

Thanks,
Purushoth
Post #637794
Posted Friday, January 16, 2009 7:53 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 21, 2013 12:32 AM
Points: 2,556, Visits: 2,593

1. You need 1 Data Flow Task, containing an EXCEL source Connection and a SQL destination connection
2. Script Task to get list of sheets within the excel file
3. For Each ADO Loop Enumerator to loop through sheets

You also need to dynamically set source connection using variables/expressions. Currently, I don't have a working example/sample of it. May be you can look BOL for information on above.


--Ramesh

Post #638092
Posted Sunday, January 18, 2009 10:34 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Friday, February 28, 2014 6:30 AM
Points: 175, Visits: 150
Ramesh,

Thanku very much for ur help.. i ll try and get back to u if i get any doubt..

Happy Programming!!!
Post #639085
Posted Sunday, April 26, 2009 11:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 28, 2011 10:38 PM
Points: 1, Visits: 28
There is a reasonably useful article on TechNet that describes most of the work needed to import data from multiple worksheets in an Excel file with SSIS.

http://technet.microsoft.com/en-us/library/ms345182.aspx

However, the last step in this article leaves you with a number of assumptions. Once you have followed all the steps listed in the technet article, this is what you have to do.

1. Add a Data Flow task to the For Each loop container.
2. In the Data Flow container, add an Excel Source component.
3. Set the OLE DB connection manager to the Excel connection manager that you would've already setup.
4. Change Data access mode for the Excel Source component to 'Table name or view name variable'. This will allow you to use the variable name to specify the name of worksheet, instead of hard coding it.
Note: You may want to use a specific sheet within the Excel file first in order for SSIS to pickup the various column names. Once you are done with the column mapping, you can change this setting back to variable name.

Now you can continue on with whatever you want to do with the data that is read from each worksheet, one worksheet at a time.

Hope this helps.

-- Adnan
Post #704727
Posted Thursday, August 06, 2009 6:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, January 02, 2014 1:24 PM
Points: 5, Visits: 94
I made an example for those people that still need:
http://biresort.net/blogs/pedrocgd/archive/2009/08/06/stepbystep-ssis-extract-data-from-multiple-excel-worksheets.aspx

I hope this help.
regards,
Pedro
www.pedrocgd.blogspot.com
Post #766117
Posted Friday, November 20, 2009 11:09 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, April 03, 2014 11:13 AM
Points: 267, Visits: 1,024
Pedro Perfeito (8/6/2009)
I made an example for those people that still need:
http://biresort.net/blogs/pedrocgd/archive/2009/08/06/stepbystep-ssis-extract-data-from-multiple-excel-worksheets.aspx

I hope this help.
regards,
Pedro
www.pedrocgd.blogspot.com


That URL no longer seems to work, I don't suppose you still have that information posted somewhere else?
Post #822568
Posted Friday, November 20, 2009 11:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, January 02, 2014 1:24 PM
Points: 5, Visits: 94
The site is temporarly down... I can send the paper I made to all those interesed on it.
Check my email in my BLOG profile and I imediatly send it to you while the site is down.
Regards,
Pedro
http://www.pedrocgd.blogspot.com
Post #822572
Posted Monday, January 04, 2010 9:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 3:32 PM
Points: 1, Visits: 35
Hi there,

Thanks for posting the link http://technet.microsoft.com/en-us/library/ms345182.aspx.

However, you also wrote that we can add an Excel Source task in the Data Flow afterwards. And in the Excel Source, select the excel connection that we've already made.

I think it's incorrect. If we follow the link, the connection we create is an ADO.NET connection, not a OLE DB connection, which is what the Excel Source required.

Could you please correct that and advise what to do after the Foreach Loop is configured?

Thanks heaps.
Post #841834
Posted Wednesday, April 14, 2010 6:36 AM


SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Yesterday @ 3:10 AM
Points: 199, Visits: 500
Thanks abader. It help me to solve the problem.
Post #903067
Posted Tuesday, November 23, 2010 2:59 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, December 16, 2013 10:42 AM
Points: 96, Visits: 434
For anyone still working on this, I found out how to pass the table name gathered in the ADO NET enumerator to the Excel source in the data flow.

1. Inside the ADO NET enumerator, add a data flow task.
2. Inside the data flow task, add an Excel source.
3. Open the Excel source, and point to the Excel data source set up in the file enumerator.
4. Select one of the sheets that shows in the drop down.
5. Close the Excel source.
6. Select the Excel source.
7. In the properties window, copy the name of the sheet you selected. It's in the 'OpenRowset' property.
8. Set this as the intitial string in your sheet name variable created to gather the sheet name from the ADO NET enumerator.
9. Select the Excel source.
10. In the properties window, change the 'AccessMode' to OpenRowset From Variable. This will change the property 'OpenRowset' to 'OpenRowsetVariable'.
11. Change the 'OpenRowsetVariable' to the variable created to hold the sheet name via the dropdown.
12. Open the Excel source. You should see your variable as the sheet name.
13. Click the 'Columns' tab to verify you can connect and mess with columns.


-------------------------------------------------------------------------------------------------
My SQL Server Blog
Post #1025519
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse