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 / SQL Execute Stored Pro...
Power Automate
Answered

SQL Execute Stored Procedure v2 suddenly very slow

(0) ShareShare
ReportReport
Posted on by 195

Hi All,

I have a simple flow which sets up some variables,  calls a SQL Stored procedure, and then sends the response back to PowerApps.

LaelH_0-1618837636760.png

LaelH_2-1618838170229.png

 

It has been running absolutely fine for months, up until 12 pm today, when it has suddenly gone from taking between 1 and 4 seconds to run, to taking up to and over 40 seconds to run.  Nothing in the data has changed. In fact, the stored procedure itself in Azure SQL is still executing in under 2 seconds - so nothing has changed there.  Something has gone pear in flow and I don't know what?  I had another flow that corrupted totally at about the same time. It just refused to execute at all - just hung up and said "running". To get that one to succeed again I had to save a copy, delete the old, rename back to original, and then delete from Power Apps and re-import to get it right. It cam right. I tried the same with this one, but sadly it hasn't worked. At least this one is still running, but it is just dog slow. 

Any ideas?

Regards

Lael

Categories:
I have the same question (0)
  • kierian Profile Picture
    on at

     

    Hello 

    Is this SQL server on prem ?

    If so please check gateway logs network errors or latency

    is the gateway up to date? 

    Have  good day

  • LaelH Profile Picture
    195 on at

    More on the above - it is  now taking over a minute and a half - it is getting worse and worse! I am so frustrated.  I noticed something weird - it seems that my environment has duplicated itself for some reason - could this be the issue? Well, not exactly duplicated, but I now seem to have two environments, both exactly the same name - one has all my flows in it, and the other is empty.

    Confusion reigns supreme.

    Any ideas? Help please?

  • LaelH Profile Picture
    195 on at

    Hi Kierian

     

    No - it is Azure SQL

  • kierian Profile Picture
    on at

    Hello

    regarding environment duplication that can cause issue because you will have duplicate flows that make same calls to same sql that not expected behavior  please open request with support so environment team can dig more see what's happened.

  • Verified answer
    LaelH Profile Picture
    195 on at

    Hi Kierian.

     

    It turned out to be a Parameter Sniffing issue in SQL - I didn't pick it up because whenever I tested the stored proc in SQL I replaced the parameters with local variables. Anyway, I found stacks in google on how to fix it and I am back to normal.  For anyone else who has the issue, google parameter sniffing and there are lots of strategies offered to fix. What worked for me was parameter masking. Not sure if it is the most elegant solution but is solves the problem.

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
Expiscornovus Profile Picture

Expiscornovus 199 Most Valuable Professional

#2
David_MA Profile Picture

David_MA 194 Super User 2025 Season 2

#3
harshdeol Profile Picture

harshdeol 167 Moderator

Last 30 days Overall leaderboard