web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem Execute SQL St...
Power Automate
Answered

Problem Execute SQL Statement

(0) ShareShare
ReportReport
Posted on by 20

Dear all,

 

i am using Power Automate Desktop to analyze excel data by SQL, but having problem when Execute SQL Statement:

after running the flow, there is no data in QueryResult (see highlight in below picture), is it normal? or is it a failure? i am not sure because there is no issue alert during flow running. could anyone give some suggestions? thanks in advance!

WendyZheng_0-1686018421749.png

 

 

I have the same question (0)
  • Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

     

    Can you check in the SQL table, whether you have the data or it is empty?

    If data is empty then that is correct

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

     

    try writing query as SELECT * FROM TABLE1

     

    Srini84_0-1686029811099.png

     

     

    For more reference you can check below link

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-microsoft-access

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

     

  • Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

     

    Check below documentation for Excel file

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Wendy-Zheng Profile Picture
    20 on at

    Hi Srini,

     

    After check, the SQL Testing excel file has data like below (1st picture). So I tested the connection of SQL and it reported an error (2nd picture), is it the cause of empty QueryResult (no SQL connection)?

    WendyZheng_0-1686030287759.png

    WendyZheng_1-1686030396226.png

     

     

     

  • Wendy-Zheng Profile Picture
    20 on at

    Thanks Srini,

     

    I tried with this code and run the flow again. Similarly, there is no alert/error during flow running but the QueryResult is still empty.

     

  • Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

     

    Did you install the below Redistribtuable?

     

    Srini84_0-1686032944451.png

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

     

  • Wendy-Zheng Profile Picture
    20 on at

    Hi Srini,

     

    Yes, I have installed it and the engine can be found in the Provider in Power Automate.

    WendyZheng_0-1686033233650.png

     

  • Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

     

    1) Check the connection string is as below

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%Excel_File_Path%;Extended Properties="Excel 12.0 Xml;HDR=YES";

     

    2) In Execute sql statment write as 

    SELECT * FROM [SheetName$]

    SheetName->Replace that with your excel sheet Name

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

     

     

  • Gidi Profile Picture
    601 on at

    Hi,

    seems you are on the right path (Configure a connection string manually)

     

    Do you really have blank password for User ‚Admin‘?

     

    Get the last error action result for more details of the problem.

    Try further with Error Handling of the used actions to find the root cause. 

  • Verified answer
    Srini007 Profile Picture
    3,473 Super User 2026 Season 1 on at

    Hi @Wendy-Zheng 

    Tried this below are the steps

     

    Srini84_0-1686034517817.png

     

     

    1) Installed the Redistruable of 64x

    2) Copied the connection string and it worked

     

    You copy the steps below and paste to the PAD

     

    SET Excel_File_Path TO $'''D:\\PRODTriggers.xlsx'''
    Database.Connect ConnectionString: $'''Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%Excel_File_Path%;Extended Properties=\"Excel 12.0 Xml;HDR=YES\";''' Connection=> SQLConnection
    Database.ExecuteSqlStatement.Execute Connection: SQLConnection Statement: $'''SELECT * FROM [Triggers$]''' Timeout: 30 Result=> QueryResult

     

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 664

#2
Haque Profile Picture

Haque 460

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard