2

i am trying to import data from an EXCEL file into SQL SERVER. When i run this query

SELECT * INTO EXCEL_IMPORT
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0; Database=C:\Users\af\Desktop\Reports\Jan_2016_Ships.xlsx; HDR=YES; IMEX=1',
'SELECT * FROM [Sheet1$]');

I get this error

The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered.

So i needed to install this driver but after doing some searches i found this :

Install Microsoft.ACE.OLEDB.12.0 driver

To import Excel 2007-2016 files to SQL Server Microsoft.ACE.OLEDB.12.0 driver should be installed.

To download the driver use the following link:

Microsoft Access Database Engine 2010 Redistributable

Don't worry about "Access" in the name.

Warning! x64 driver can not be installed if Microsoft Office 2007-2016 x86 is already installed!

So there is no way to import Excel data to SQL Server x64 using OPENROWSET/OPENDATASOURCE functions on a machine with Microsoft Office x86!

So i couldn't install this driver because i have SQL SERVER x64 and Microsoft Office x86. I don't want to use the simple import wizard because i have many tables and i need to check the data type of the columns... it will be time consuming in my case.

I believe there should be a solution to run my query on SQL SERVER x64 and Microsoft Office x86.

Any suggestions please ? Thank you very much

2
  • convert file Jan_2016_Ships.xlsx to Jan_2016_Ships.xls then check Commented Nov 4, 2016 at 12:19
  • the same error as before Commented Nov 4, 2016 at 14:57

4 Answers 4

1

Best way of Import/Export data into Sql Server is Import/Export Wizard facility in SQL Server .

Please refer below link .

http://searchsqlserver.techtarget.com/feature/The-SQL-Server-Import-and-Export-Wizard-how-to-guide

Thanks .

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for your advice but i am looking for a solution how to run it directly from a query not through the import wizard
0

If you run it only once you may can run the query in a SSIS package and change the solution to 32bit-mode (right-click the solution, properties, debugging, run64bitRuntime = false)

Comments

0

Is microsoft excel installed in your system?. this might solve your problem.

Also you can import to a table manually by SQL management studio.

right Click on database > Tasks > Import Data

3 Comments

thank you for your suggestion but i am looking for a solution how to run it directly from a query
get driver from this link. install it and try query again. microsoft.com/en-us/download/details.aspx?id=13255
Thanks for your suggestion but i receive the same error when i try to install it "Can not install 64 bit version of MS Database Engine because i have 32 bit office products"
0

It looks like you are mixing 32-bit drivers with 64-bit drivers. This is a big nono. These two resources are probably your best place to start.

http://www.cnblogs.com/anorthwolf/archive/2012/04/25/2470250.html

http://www.excel-sql-server.com/excel-sql-server-import-export-using-vba.htm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.