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

Community site session details

Session Id : 0OuB2SLnNeAmWr9XlsvO5a
Power Automate - Building Flows
Answered

Azure SQL Stored Procedure suddenly run super slow and timeout

Like (0) ShareShare
ReportReport
Posted on 28 May 2024 11:08:59 by 112

I have a Azure SQL Stored Procedure, I use the "Execute stored procedure (V2)" to run it in the cloud flow.

 

Last week it return a 3000 rows table for only 30 seconds, but this week suddenly the workflow timeout always. The Stored procedure works fine by running directly in Azure Data Studio and maximum runs 59 seconds. It only run slow in Power Automate and timeout after 110 seconds. I checked that it might be the parameter sniffing in SQL, but I don't think fits my case.

 

Is there any changes for "Execute stored procedure (V2)" action recently? or any others from the community facing the same issue and find the solution?

  • Verified answer
    MengtingXie Profile Picture
    112 on 11 Jun 2024 at 07:36:58
    Re: Azure SQL Stored Procedure suddenly run super slow and timeout

    I found the solution for this issue myself. It is about "Parameter Sniffing". I tried two solutions from this article https://www.linkedin.com/advice/0/what-best-practices-avoiding-parameter-sniffing

     

    The first solution for avoiding parameter sniffing is to use local variables, this doesn't help. On the contrary it makes my stored procedure slower. Not sure why.

     

    The fourth solution for avoiding parameter sniffing is to use RECOMPILE hints. This is the great savior for my stored procedure running by Power automate. I just added OPTION (RECOMPILE); at the end of my stored procedure, the the stored procedure running by Power Automate will always finish within 30 seconds. No timeout anymore. 

     

     

    OPTION (RECOMPILE);

     

     

     

    MengtingXie_0-1718091099497.png

     

     

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2