469,077 Members | 1,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

importing multiple excel files

Hi

I have multiple excel files of the same format in a directory.
They are called book1.xls, book2.xls, book3.xls and so on.
What is the easiest way to import the tab named sheet1 from each of
the excel files to a databse using SQL server 2000 enterprise edition?

Regards,
Ciarán
Feb 14 '08 #1
2 4216
Here is a good article that outlines different methods to import Excel
sheets into SQL Server (DTS, linked server, distributed queries, client
side, etc.). Since you are dealing with multiple files it is probably best
to do it client side.

http://support.microsoft.com/kb/321686

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Feb 14 '08 #2
You could use the below, and then adapt if necessary to make dynamic

SELECT *
INTO MyTable
FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0'
,'Excel 8.0;Database=C:\myEXCEL.xls'
,'SELECT * FROM [Sheet1$]'
)
--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com


<ci***********@gmail.comwrote in message
news:2f**********************************@e6g2000p rf.googlegroups.com...
Hi

I have multiple excel files of the same format in a directory.
They are called book1.xls, book2.xls, book3.xls and so on.
What is the easiest way to import the tab named sheet1 from each of
the excel files to a databse using SQL server 2000 enterprise edition?

Regards,
Ciarán
Feb 15 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Kathie via AccessMonster.com | last post: by
5 posts views Thread by hharriel | last post: by
3 posts views Thread by scoots987 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.