Importing data from multiple sheets in an excel file with same schema into single destination table in sql server

rated by 0 users
This post has 28 Replies | 3 Followers

Top 10 Contributor
Points 800
gvamsimba Posted: 08-03-2009 17:19

HI, i have an excel file with multiple sheets with
same schema. can any one create a sample package to import
the data from all sheets from the excel file into a single destination table
in sql server 2005.. Many Thanks..

  • Filed under:
  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

I can do it for you!

Just attach or send me the excel file.

Regards,

Pedro

  • | Post Points: 20
Top 10 Contributor
Points 800

 

HI Pedro, attached is my test data with 3 sheets.. Many Thanks..

 

6114.Test.xls

  • Filed under:
  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

I'll check it during the day.

Regards,

Pedro

  • | Post Points: 5
Top 10 Contributor
Male
Points 1.490

I have your solution made and I'll post as a StepByStep post.

Please describe the scenario/problem in more detail to publish.

Regards,

Pedro

  • | Post Points: 20
Top 10 Contributor
Points 800

HI Pedro,

                      Here is the Scenario. I have an excel file to import into SQL Server in a single destination table. The excel file has multiple sheeets with similar schema. I want to import the data from all the sheets into a single table.

Thank You.

 

  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

and the environment? The data is about customers? Suppliers? from and to where ?

Thanks my friend!

Pedro

  • | Post Points: 20
Top 10 Contributor
Points 800

Environment is SQL Server 2005.We are getting the data everymonth
from the customers in excel files which we need to load it
into SQL Server. the situation above is to import a single
excel file with multiple sheets with same schema into a
single destination table in sql server 2005.

Hope this helps.

Thanks.

  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

Here you have:

http://biresort.net/blogs/pedrocgd/archive/2009/08/06/stepbystep-ssis-extract-data-from-multiple-excel-worksheets.aspx

Check the attached document and give feedback in the blog post.

Helped?

regards,

Pedro

  • | Post Points: 5
Top 10 Contributor
Male
Points 1.490

You saw the blog post? It's usefull for you!?

regards,

Pedro

  • | Post Points: 5
Top 10 Contributor
Male
Points 1.490

Improvements?!

  • | Post Points: 20
Top 10 Contributor
Points 800

Thank you very much pedro. I will check this and will let you know my monday.. many thanks and have a good weekend.

  • | Post Points: 5
Top 10 Contributor
Points 800

HI Pedro,

                      Thanks for this. But  i am getting an error message as follows after running the package with the same excel file which i have attached previously. I have attached my package . Can you please let me know where i have gone wrong ?

Thanks.7723.SSIS_EX_03_FELC_vamsi.zip

 

  • | Post Points: 5
Top 10 Contributor
Points 800

sorry here is my error message

 

Error: 0xC0202009 at DFT Extract Data From Excel, EX_SRC Get Each WorkSheet Data [1]: An OLE DB error has occurred. Error code: 0x80004005.
Error: 0xC02020E8 at DFT Extract Data From Excel, EX_SRC Get Each WorkSheet Data [1]: Opening a rowset for "'01$'  " failed. Check that the object exists in the database.

  • | Post Points: 5
Top 10 Contributor
Points 800

pedro, when the above package have failed, i have renamed the first excel sheet from 01 to ram, but still i am getting the same error..

  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

Dont forget the point 5.2 and to unsure that the worksheet name is 01

 Click on the Excel Source Component and in the properties menu change the AccessMode property to “OpenRowset From variable

 

  • | Post Points: 20
Top 10 Contributor
Points 800

Thank YOu Very much pedro. it works perfectly now. Can you
please add one small requirement to the package. Actually
i have 31 sheets in the file from 01 to 31 which implies
to 31 days of a certain month. so I will add a new column
named 'date' in the destination table. so all the data from 01
shuld be dated as 01-08-2009 and the data from 02 should be
02-08-2009 in the 'date' column and so on..

Can you please add this requirement to the package ?

Many Thanks

  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

and the month and year are calculated based on the currentdate, correct?!

 

  • | Post Points: 20
Top 10 Contributor
Points 800

it should be for previous month in the current year..then
i can change it accordingly..
Thanks

  • Filed under:
  • | Post Points: 5
Top 10 Contributor
Points 800

HI Pedro, any update on this ?

Thanks

  • Filed under:
  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

Sorry for the delay!

I'm very busy... but I'll try to do it during the day!

Regards,

Pedro

  • | Post Points: 20
Top 10 Contributor
Points 800

HI Pedro,

                    Any update on this. Can you please add that extra date
condition which i have requested in that package which you
created please ?
Thanks

 

  • | Post Points: 20
Top 10 Contributor
Male
Points 1.490

Here you have the updated package.

Take a look.

  • | Post Points: 5
Top 10 Contributor
Male
Points 1.490

Improvements?

  • | Post Points: 20
Top 25 Contributor
Points 35

 

 

Am having this error mates...

 

[EX_SRC Get Each WorkSheet Data [1]] Error: Opening a rowset for "'01$'                                             " failed. Check that the object exists in the database.

 

I have checked the point 5.2 also in the document.Evereything is set up correctly...But somehow this error keep peeping out......Any ideas please share it mate......This solution i need it urgently.............

  • | Post Points: 5
Page 1 of 2 (29 items) 1 2 Next > | RSS