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
 Script Library
 Import Excel Data to a sql server table

Author  Topic 

vimalraj
Starting Member

5 Posts

Posted - 2007-09-11 : 01:36:38
Hi,

I need to import data from more than 10 excels having the same format in to a single sql server table.

I tried to use

INSERT INTO MyTempTable
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 11.0;Database=C:\Book1.xls', [Sheet1$])

but got the below error
Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied. You must access this provider through a linked server.

If DTS package is used then I am not sure how I can place 10 excels at a time so that they can be picked one by one and data is imported in to table.

Please help.

Thanks,
Vimalraj



SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-11 : 01:44:01
This is already discussed in detail here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

And it seems you are using SQL Server 2005. Please use the Surface Area Configuration to allow AD HOC queries.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -