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)
 Error trying to import excel file into sql2000

Author  Topic 

wile
Starting Member

3 Posts

Posted - 2009-02-26 : 16:21:08
Hello

I am trying to import an excel spread into a new sql2000 tbale using the following tsql code. I an also getting thr following error, can anyone help.

Thanks
JW


select * into Temp_scac_codes from OPENROWSET ('MICROSOFT.Jet.OLEDB.4.0',
'Excel 8.0;Database=d:\SOU_Combined_Haulers_From_GB.xls:HDR=YES',
'SELECT * from [Sheet1$]')



The error is:

Server: Msg 7399, Level 16, State 1, Line 1
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: ].

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-26 : 16:39:31
Does this "d:\SOU_Combined_Haulers_From_GB.xls" exist on the server or only on the client machine?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

wile
Starting Member

3 Posts

Posted - 2009-02-26 : 16:53:18
Yes the "d:\SOU_Combined_Haulers_From_GB.xls" exist on the server, I ran the query on the server

JW
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-26 : 17:05:09
Then the next question is whether or not the worksheet is actually named Sheet1$. Beyond that, I don't know.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -