cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dom32
Regular Visitor

SQL Server Execute Stored Procedure V2 error

Hello, 

 

I am just getting started using Power Automate and Power Apps (so real NEWBIE) and I am trying to use the SQL Server Execute Stored Procedure (V2) using a very simple SP (insert a new row in a table). After I select the server, database and stored procedure I get an error message : 'body" is required (see image below). What am I doing wrong?

 

I know my on premise gateway connection is working because I tested it with a SQL Server Insert row and that was working.

 

Any help/guidance would be much appreviated.

 

Thanks!

SQL_ESP_error.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dom32
Regular Visitor

Hi dvtkiet

 

I think the stored procedured requires at least one "INPUT" per the online documentation. I added an input to my stored procedured and I was able to use it with a button no problem.

 

https://docs.microsoft.com/en-us/connectors/sql/#execute-stored-procedure-(v2)

 

Hope it works for you.

 

Cheers

 

sql_SPv2.png

View solution in original post

10 REPLIES 10
fchopo
Super User
Super User

Hello @Dom32 

Which type of authentication do you use to connect to SQL Server? Maybe it's something with the connection. Could you provide more detailed information?

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Dom32
Regular Visitor

Hi Ferran

 

the connection is using SQL authentication. I was able to get the Execute Stored Procedure V2 working using a Power Automate button. 

 

I just find it strange that it is not working with a Power Apps (even though they have a template for it). I would like to be able to trigger the SP within a Power App form.

 

thanks!

Hello @Dom32 

Really weird. Have you tested it with another SP just in case there's something with it? There's an excellent video on how to call SP from PowerApps here: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Calling-Stored-Procedures-from-within...

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Dom32
Regular Visitor

Hello group

 

well, I added a variable as input in my stored procedure to update one of the field and everything started working as expected. I guess I should have pay more attention to the "requirements" 🙂

 

Initially I was trying to execute the SP without a variable.

 

Sorry for your time, love this Power Automate stuff.

 

D

 

 
dvtkiet
Frequent Visitor

I have the same problem, and my stored procedure doesn't need any input parameter (it creates a table from different tables.
The stored procedure executes well in SQL; but when I call the stored procedure using Execute Stored Procedure V2, I get the error "Body is required."
Thank you in advance for your help.

Dom32
Regular Visitor

Hi dvtkiet

 

I think the stored procedured requires at least one "INPUT" per the online documentation. I added an input to my stored procedured and I was able to use it with a button no problem.

 

https://docs.microsoft.com/en-us/connectors/sql/#execute-stored-procedure-(v2)

 

Hope it works for you.

 

Cheers

 

sql_SPv2.png

dvtkiet
Frequent Visitor

Hi @Dom32, It works. Thank you so much for your help and the documentation.

Zap174
Helper II
Helper II

Hi @dvtkiet 

How did you add an input to your stored procedure? Could I see an example?

Dom32
Regular Visitor

This is how I added my INPUT to my stored procedures

Dom32_0-1655907027900.png

then in Powerautomate, the INPUT will be listed

Dom32_1-1655907110933.png

 

Thank you so much!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,543)