Inserting data from an Excel file to a database

I

i.sobha

Hi,

I have an auto generated excel file(.xlsx) in a particular format .

I tried importing the file to the SQL server database using the query
below.

SELECT * INTO temp_ExcelData2 FROM OPENROWSET('Microsoft.ACE.OLEDB.
12.0','Excel 12.0 Xml;Database=C:\test
\DashboardData.xlsx;HDR=No;IMEX=1','SELECT * FROM [Sheet1$]')

It is showing an error as

Could not locate registry entry for OLE DB provider
'Microsoft.ACE.OLEDB.12.0'. SELECT * INTO temp_ExcelData2 FROM
OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0 Xml;Database=C:\test
\DashboardData.xlsx;HDR=YES;IMEX=1','SELECT * FROM [Sheet1$]') OLE DB
error trace [Non-interface error: Provider not registered.].

Also I tried importing an xls file using the below command the same
worked perfectly fine.
SELECT * INTO temp_ExcelData FROM OPENROWSET('Microsoft.Jet.OLEDB.
4.0','Excel 8.0;Database=C:\test\mydata.xls;IMEX=1','SELECT * FROM
[Data$]')

Please provide help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top