Skip to main content
Community site session details

Community site session details

Session Id : 23PpTf1Rt+GzH7wqdLKe91
Power Automate - Building Flows
Answered

SQL Server Execute Stored Procedure V2 error

Like (0) ShareShare
ReportReport
Posted on 13 Apr 2020 14:40:01 by

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

 

  • n0va Profile Picture
    2 on 15 Feb 2024 at 01:14:02
    Re: SQL Server Execute Stored Procedure V2 error

    Parameter List is a JSON field, so using {} (an empty JSON object) works.
    Found in a SQL tech community  post and it worked for me.

  • Tina Chen Profile Picture
    90 on 24 Dec 2023 at 08:15:27
    Re: SQL Server Execute Stored Procedure V2 error

    This issue happened to me when i deployed my solution from dev to staging.

    My flow, which doesn't take any input from powerapps, executes a GET stored procedure (V2). It worked fine in my dev environment but got this error message in staging environment. 

     

    I simply removed then recreated the PowerApps(V2) step and Execute Stored Procedure(V2) steps in flow, save, and everything works fine. Error message is now gone. 

  • DavidInBkk Profile Picture
    6 on 12 Jul 2022 at 15:28:44
    Re: SQL Server Execute Stored Procedure V2 error

    Personally, rather than using resultsets, I would use JSON instead. Someting like this:

    CREATE PROC [logdata].[UpdateShopifyOrdersDataV2]
    (
     @ID BIGINT,
     @JSON NVARCHAR(MAX) OUTPUT
    )
    AS
    BEGIN
    SET @JSON =
       (
       SELECT TOP 1
           Id
           ,StoreCode
           ,OrderName
           .
           .
           .
       FROM
            LogData.GetInvoiceData I
        WHERE
             Id = @ID
         FOR JSON PATH
         );

    END;

    Then put the JSON through the JSON object power automate, use a sample output of your json query to create the schema, and go from there. Much easier to deal with and works great in Azure or on-premise.

  • Zap174 Profile Picture
    165 on 22 Jun 2022 at 14:22:55
    Re: SQL Server Execute Stored Procedure V2 error

    Thank you so much!

  • DR-01081351-0 Profile Picture
    on 22 Jun 2022 at 14:12:05
    Re: SQL Server Execute Stored Procedure V2 error

    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

     

  • Zap174 Profile Picture
    165 on 21 Jun 2022 at 13:57:11
    Re: SQL Server Execute Stored Procedure V2 error

    Hi @dvtkiet 

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

  • dvtkiet Profile Picture
    6 on 23 Apr 2020 at 15:12:43
    Re: SQL Server Execute Stored Procedure V2 error

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

  • Verified answer
    DR-01081351-0 Profile Picture
    on 23 Apr 2020 at 12:51:10
    Re: SQL Server Execute Stored Procedure V2 error

    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 Profile Picture
    6 on 22 Apr 2020 at 22:28:36
    Re: SQL Server Execute Stored Procedure V2 error

    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.

  • DR-01081351-0 Profile Picture
    on 15 Apr 2020 at 18:58:04
    Re: SQL Server Execute Stored Procedure V2 error

    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

     

     

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete