Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?

(0) ShareShare
ReportReport
Posted on by 119

Hi everyone,

I’m trying to run a simple SQL query on my on-premises SQL database using Power Automate, but I’m unable to get it to work.

Is there any alternative solution that you could recommend to query the on-prem database via Power Automate or perhaps another method that might be more suitable?

Any suggestions would be appreciated. Thanks in advance for your help!

Categories:
  • Verified answer
    lbendlin Profile Picture
    7,943 Super User 2025 Season 1 on at
    Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?
    That's a well known artificial limitation.  One workaround is to create a Stored Procedure for each of your queries.
  • razec18 Profile Picture
    119 on at
    Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?
    Im just trying to select some items from a table. And it seems that the issue only happens when I use Execute SQL Query V2

    With other connectors of SQL, I can use it properly, and it works with my on premises data gateway.
  • Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?
    Can you share the code view of your action? What query were you trying to use? Just trying to figure out why your current setup is not working. SQL authentication should work if you got a working on-prem gateway setup.
     
    Regarding desktop flows. You don't necessarily need to run it on a VM btw, you have different setup options for Power Automate Desktop.
     
    You can even run it attended on your own machine (which is probably not the preferred way, but it is possible). It depends a bit on your requirements.
     
     
     
  • razec18 Profile Picture
    119 on at
    Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?
    Hi, I used exactly SQL Server Authentication.

    The point to use Cloud Flows it's because of cost reduction.

    To use a Desktop Flow, I would need a VM to do it.
  • Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Unable to Run SQL Query on On-Prem Database via Power Automate - Any Alternatives?
    What setup did you use in the connection? Can you share a bit more details about that configuration (which authentication for example?)
     
     
    Alternatively, have you tried desktop flows (Power Automate Desktop) instead of cloud flows?
     
    Desktop flows also have Database type of actions:

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >