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 can I execute a st...
Power Automate
Unanswered

How can I execute a stored procedure from my cloud workflow?

(0) ShareShare
ReportReport
Posted on by 277

Hello everyone, 

 

I've realized that connecting my cloud workflow to the database necessitates using the on-on-premises data gateway. Unfortunately, I've also discovered a limitation: the inability to execute queries from a cloud-based workflow to an on-prem database.

 

While one solution involves leveraging processes stored within the database, I'm concerned about potential gateway failures when attempting to connect to my on-prem database server. If such a scenario occurs, I'm seeking alternative methods to establish and maintain the connection between my workflow and the database.

 

The workflow's functionality is dependent on monitoring a specific table on the server and initiating actions when a new record is created. This mandates a continuous connection to the database server.

 

Any suggestions on ensuring this uninterrupted connection would be greatly appreciated.

 

Thank you.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    There is an action built in to the SQL connector that will let you execute a SQL stored procedure.

    image.png

    But why do you say that you can't execute a SQL query from a cloud flow? There is also an action in the SQL connector that lets you do that.

    image.png

    Both of those work on a connection through an on-premises gateway. If you are concerned about redundancy you can create a pool of gateways in case one fails.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    @Pstork1 , the Execute SQL statement does not support on-premise SQL server. That's clearly stated in the documentation for the connector.

     

    @ADumith , the gateway works fine for monitoring databases and having a constant connection. We have several clients relying on this functionality, and have yet to face any issues with it. 

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

     

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

    You are correct about the query. I had forgotten that. But the Stored Procedure action is supported on-premises.  I normally prefer using Stored Procedures anyway if you have access to create them.

  • ADumith Profile Picture
    277 on at

    Hello guys, 

     

    Thank you so much for your reply.

     

    So, what type of authentication do you recommend me?

    Because no matter which one I select it's asking me to indicate which data gateway I am going to use for the connection.

     

    ADumith_0-1701894981161.png

     

    Thank you again, 

     

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

    Any of these will require an on-premises gateway. There is no way to run any kind of cloud flow against on-premises SQL without a gateway.  But as I mentioned in my first reply if you are concerned about redundancy of the gateway you can create a gateway cluster that will keep working if one gateway goes down.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Yes. That's exactly why I recommended they use a Stored Procedure under a different thread, as that is the best way to do what they want to do on an on-prem SQL server.

     

    @ADumith , as @Pstork1 mentioned, you will need a gateway anyway. No other way to connect to an on-prem database in PA cloud. The auth method of your choice really depends on the authentication settings on the server. The most frequent cases are either using SQL Server Authentication (where you provide a user name and a password), or Windows Authentication (where your windows user is used for auth). It usually is set up on the server side, and it's not like you can choose the one you prefer the most (unless you set up the server).

     

    So, use the one you normally use when running queries to the database.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • ADumith Profile Picture
    277 on at

    Thank you gentlemen for clarifying my doubts.

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