Forum Discussion

Santosh20's avatar
Santosh20
Copper Contributor
Nov 05, 2023

How to import data in SQL server from excel

Hello Experts

I am trying to import data from Excel to SQL server table using OPENROWSET and it gives me below error.

Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine”

 

I'm using above provider in my code, can someone also correct me if I am using correct provider or I need to use different to read data from Excel?

My Excel file is placed on Azure storage account and I am using UNC path to read data in SQL script

 

Thanks 

6 Replies

    • Santosh20's avatar
      Santosh20
      Copper Contributor
      I am using
      Select * from oenrowset( provider name and path of Excel file)
  • Matt_Griffiths's avatar
    Matt_Griffiths
    Copper Contributor
    Have a look at this Q&A https://learn.microsoft.com/en-us/answers/questions/1319599/how-to-fix-the-microsoft-ace-oledb-12-0-provider-i
  • olafhelper's avatar
    olafhelper
    Bronze Contributor

    Santosh20 


    My Excel file is placed on Azure storage account 

    ACE data provider don't support Azure storages.

    • Santosh20's avatar
      Santosh20
      Copper Contributor
      Thanks olafhelper,
      So could you please suggest me a workaround?
      How I can read data from Excel using OPENROWSET in SQL MI ?

  • Arshad440's avatar
    Arshad440
    Copper Contributor
    Hi,
    would you try to import the excel into SQL server using SQL server Import And Export Data Console Window.

Resources