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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to Run SQL Quer...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 123

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:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at
    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:
  • razec18 Profile Picture
    123 on at
    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
    33,189 Most Valuable Professional on at
    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
    123 on at
    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.
  • Verified answer
    lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at
    That's a well known artificial limitation.  One workaround is to create a Stored Procedure for each of your queries.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard