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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 exporting excel data into sql server table

Author  Topic 

tsvenumadhav
Starting Member

5 Posts

Posted - 2005-12-21 : 07:36:03
hi Madhivanan

I have the excel file called test.xls. it contains data like

id name age sex
111 xxx 20 f
222 yyyy 30 m
333 zzzz 40 f

i have sql server table called testexcel with same coloums.


my query is

Insert into testexcel Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test.xls;HDR=YES',
'SELECT * FROM [Sheet1$]')



when i run the above query in the query analyzar i am getting the following error

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].



what's the wrong with my query...


plese give me help very urgent....

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-12-21 : 07:44:41
Hi,
Just in case this question was meant for everybody and not Madhivanan exclusively

Is the sheet where the data is on the excel spreadsheet Called 'Sheet1' or is it maybe called something else?


Duane.
"It's a thankless job, but I've got a lot of Karma to burn off."
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-21 : 08:08:44
You need to replace 'Sheet1$' by the actual sheet name of the file

Madhivanan

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

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-21 : 08:41:41
quote:
Originally posted by tsvenumadhav

hi Madhivanan


quote:
Originally posted by ditch

Hi,
Just in case this question was meant for everybody and not Madhivanan exclusively



if its for Madhivanan,
then post it here https://www.madhivanan.com/forums/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-21 : 09:00:48
quote:
if its for Madhivanan,
then post it here https://www.madhivanan.com/forums/



Madhivanan

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

- Advertisement -