Glad I could be of any help and thanks for the grade !
Main Topics
Browse All TopicsI need to create a SQL Server database from data in an MS Excel spreadsheet
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
yep, here's a nice way to do that:
1. In the excel sheet, select a range that you want as a table.
2. Select from the menu insert, name, define ...
3. Give in a name for the selected area.
4. repeat this step for each table you want in SQL Server.
5. close the excel sheet.
6. from sql server create the tables.
7. for each table run the script:
insert into <Table>
SELECT *
FROM OPENDATASOURCE
( 'Microsoft.Jet.OLEDB.4.0'
, 'Data Source="X:\Path\To\File.xl
... done.
Tables need to be created by hand this way.
If you are looking for a automatic way to create the tables as well, use the import/export wizard:
Open a connection to the database from SSMS, in the object explorer pane, right click the database and select tasks, import data. From there follow the wizard.
Hope this helps ...
sql is getting this while excuting the above said soulution by Yveau, SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource
I defined an area in my spreadsheet called "DataFeed" as follows, =Sheet1!$B$2:$I$500
then in Qry Analyzer I run the following select,
select * into sheetdata from OPENROWSET ('Microsoft.Jet.OleDB.4.0'
however, I noticed that the resulting column in my Sql table are not in the same order (i.e. column B and C should be my first two rows, but are coming in as the last two).
Any ideas on how to specify the order of which I pull my columns from the spreadsheet ?
Thanks,
Bob
Business Accounts
Answer for Membership
by: YveauPosted on 2007-10-10 at 13:18:58ID: 20051969
yep, here's a nice way to do that: s";Extende d Properties=Excel 8.0')...[AreaName]
1. In the excel sheet, select a range that you want as a table.
2. Select from the menu insert, name, define ...
3. Give in a name for the selected area.
4. repeat this step for each table you want in SQL Server.
5. close the excel sheet.
6. from sql server create the tables.
7. for each table run the script:
insert into <Table>
SELECT *
FROM OPENDATASOURCE
( 'Microsoft.Jet.OLEDB.4.0'
, 'Data Source="X:\Path\To\File.xl
... done.
Tables need to be created by hand this way.
If you are looking for a automatic way to create the tables as well, use the import/export wizard:
Open a connection to the database from SSMS, in the object explorer pane, right click the database and select tasks, import data. From there follow the wizard.
Hope this helps ...