inspiraller
Programmer
Hello
I would like to make a connection to an excel database on an external server from sql server via a stored procedure and import the data from it.
I have tried importing data from the excel database sitting on the local harddrive of the sql server and that works, however I will need to access it from an external server.
WORKING VERSION (EXCEL DB ON SAME PC AS SQL SERVER)
create procedure sp_excel_to_sql
as
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="F:\Program Files\Microsoft SQL Server\stevesdb\test3.xls";Extended properties=Excel 8.0')...[Sheet1$]
GO
NON WORKING VERSION
create procedure sp_excel_to_sql
as
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=" properties=Excel 8.0')...[Sheet1$]
GO
ERROR:
Error 7399: 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' IDBInitialiaze::Initialize returned 0x80004005: The provider did not give any information about the error.].
I would like to make a connection to an excel database on an external server from sql server via a stored procedure and import the data from it.
I have tried importing data from the excel database sitting on the local harddrive of the sql server and that works, however I will need to access it from an external server.
WORKING VERSION (EXCEL DB ON SAME PC AS SQL SERVER)
create procedure sp_excel_to_sql
as
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="F:\Program Files\Microsoft SQL Server\stevesdb\test3.xls";Extended properties=Excel 8.0')...[Sheet1$]
GO
NON WORKING VERSION
create procedure sp_excel_to_sql
as
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=" properties=Excel 8.0')...[Sheet1$]
GO
ERROR:
Error 7399: 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' IDBInitialiaze::Initialize returned 0x80004005: The provider did not give any information about the error.].