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 2005 Forums
 Transact-SQL (2005)
 import from excel

Author  Topic 

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2007-02-25 : 21:28:21
i know this has been spoken off before but this problem felt a little more specific...

i am trying import a csv file into a non existing table im running this

USE admin
GO
select *
into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=c:\mina\message_log_61607.csv;HDR=YES',
'SELECT * FROM [message_log_61607$]')

but i get this error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".


rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2007-02-25 : 21:37:53
nm its becuase i had it as csv
Go to Top of Page

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2007-02-26 : 01:32:25
r u executing this query on machine, i mean where SQL server is installed, or through client?

If u don't, u have to execute on server where it is installed, coz the path u have mentioned, sql server considers the local path. it will search the .CSV file on the given location.

let us know,

Mahesh
Go to Top of Page

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2007-02-26 : 20:44:09
it was done on the server itself... but its okay now, thanx heaps.
Go to Top of Page
   

- Advertisement -