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
 General SQL Server Forums
 New to SQL Server Programming
 Multiple Excel Sheets

Author  Topic 

LedZeppelin
Starting Member

3 Posts

Posted - 2007-04-18 : 06:00:47

Hello all!

Actually I've got multiple questions - but will start with 1. :)

My task in three words:
Use Grand Prix data and make it so that you can ask questions to it via SQL Server or by using Excel.

What I did so far:
I gathered the GrandPrix data from f1db.com - I stored the data in multiple Excel Files - I created a Formule1 database - I created separate packages for all the data. Which means, im cloning the data from Excel to SQL Server.

What I'm doing now:
In SQL Server Management Studio I am creating new tables in which I store (using SQL queries) the data from the packages that I loaded into the Database. This is going very well so far - and I'm proud of that. ;)

The problem:
Most Excel files have only 1 sheet and where the first row are the identifying column-names. I now however have 1 Excel files that exists of multiple sheets, perhaps 40 or something. I could create a package and run this which would result in 40 new tables in SQL Server Management Studio. I bet that would work just fine. But how - and here comes the main question - do I copy information from those 40 tables (former sheets) into 1 new table.

it's hard to explain what I want to be the result...

Ok, i made a screenshot and added some notes that makes the whole situation more clear:
direct link: http://img243.imageshack.us/img243/9462/whatimtryingfx9.png

I suppose this requires a complex SQL Query, hopefully someone can help me out or point me into the right direction. Much appreciated!

Thank you.
LedZeppelin


'Does anybody remember laughter?' - Robert Plant

LedZeppelin
Starting Member

3 Posts

Posted - 2007-04-23 : 02:55:49
is there really nobody who can help? it'd be greatly appreciated. :D

'Does anybody remember laughter?' - Robert Plant
Go to Top of Page

SatyaSKJ
Starting Member

46 Posts

Posted - 2007-04-23 : 04:32:33
You can create sheets in the existing table using Execute SQLTash to create number of sheets that are present in that Excel file too.

Satya SKJ
SQL Server MVP
http://www.sqlserver-qa.net
Go to Top of Page

LedZeppelin
Starting Member

3 Posts

Posted - 2007-04-23 : 06:14:54
SayaSKJ, thank you for your reply. I'm not sure what you mean. However, if I execute the package which contains all the data from the 40 sheets or so I get 40 new tables in Management Studio.

Now I want some SQL query that can extract that data and put it in 1 new Table in Management Studio. (see screenshot in the first post for an overview of how I want the structure to be)

'Does anybody remember laughter?' - Robert Plant
Go to Top of Page
   

- Advertisement -