dbTalk Databases Forums  

importing multiple excel files

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss importing multiple excel files in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ciaran.hudson@gmail.com
 
Posts: n/a

Default importing multiple excel files - 02-14-2008 , 03:50 PM






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

Reply With Quote
  #2  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: importing multiple excel files - 02-14-2008 , 05:26 PM






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


Reply With Quote
  #3  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: importing multiple excel files - 02-15-2008 , 02:51 AM



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




<ciaran.hudson (AT) gmail (DOT) com> wrote

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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.