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
 Import Excel data to database

Author  Topic 

VimalSrivastava
Starting Member

1 Post

Posted - 2011-05-16 : 09:35:10
Hi There,

I am new to sql. I am using SQL server 2000. Here i wanna to import excel data to my data base. The table name should be same as my excel sheet name. I need to automate it.

The code i have used for this is given below:
SELECT * into #Vimal
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\Vimalkumar\Test.xls',
'SELECT * FROM [Test$]'


But when i use to execute the code, i am getting the error mentioned below highlighted with red color
"OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.]."

Could any body help me to come out of this?

Regards,
Vimal Srivastava

Vimal Kumar

pduffin
Yak Posting Veteran

68 Posts

Posted - 2011-05-16 : 20:38:51
Does "D:\Vimalkumar\Test.xls" refer to a location on the machine which the SQL instance is hosted? If not it has to be or you should supply a network path.
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-05-16 : 20:54:10
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Cheers
MIK
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-05-17 : 05:48:24
Also the excel file should be closed at the time of querying. Refer the above link for more informations

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

manju3606
Yak Posting Veteran

78 Posts

Posted - 2011-05-17 : 07:44:59
use DTS package TO import excel data to YOUR data base

Manju
Go to Top of Page
   

- Advertisement -