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 / How to get past on-pre...
Power Automate
Answered

How to get past on-premise gateway limit, Execute a SQL Query (v2)?

(0) ShareShare
ReportReport
Posted on by 221

Does anyone know how to attach an SQL query to execute OnSelect with ANY PowerApps control that doesn't involve the 'Execute a SQL query (v2)' step in Power Automate?

 

I need a button control in my app to execute a SQL query that averages integer entries collective over time. The average will change frequently so this SQL query will need to be executed on each new entry, which brought me to using a Power Automate flow that simply triggers the query.

 

I've now aware that the 'Execute a SQL query (v2)' step in Power Automate does not support on-premise gateways, which I am bound to use by company IT rules. Therefore using Power Automate feels dead in the water.

 

Ginko_0-1647554280381.png

 

Thank you in advance!

Categories:
I have the same question (0)
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @Ginko unfortunately it's not possible

  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    First, if your SQL server is on-premises then a on-premises gateway is required whether you are using Power Apps or Power Automate.  But Power Automate definitely supports connections that make use of an on-premises gateway.  However, you can execute a query against an on-premises SQL server whether you have a gateway or not.  The workaround would be to build your query as a stored procedure in the SQL server.  You can execute a stored procedure in an on-premises SQL server using Power Automate. However,  you can't do it from Power Apps directly.  You have to call a flow since only flows have an action to execute a stored procedure.

  • Carus010 Profile Picture
    11 on at

    Do you know of any alternatives to creating a stored procedures? Our data warehouse team does not allow us to create db objects - we can only query the tables. I need a way to execute a query that includes multiple joins, but can't find any Flows that support this. Thanks.

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    This question was about querying a sql server on-premises without a data gateway. Please post your question as a new question in the forums.  The short answer is that there is an action that will let you run a regular SQL query against a sql server.

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard