Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

SQL Server Execute Stored Procedure V2 error

(0) ShareShare
ReportReport
Posted on 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 at
    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 at
    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 at
    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
    163 on at
    Re: SQL Server Execute Stored Procedure V2 error

    Thank you so much!

  • DR-01081351-0 Profile Picture
    on at
    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
    163 on at
    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 at
    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 at
    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 at
    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 at
    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >