none
Azure stored proc containing a sub stored proc - how to return status cde of sub proc? RRS feed

  • Question

  • Hi,

    I've set up the appropriate logic app activity to execute an Azure SQL stored proc.  Within the stored proc there is an additional stored proc which is also run (a sub stored proc).  I am trying to obtain a success/fail code back into Logic Apps from the sub stored proc.  At the moment when primary key vioilations or similar occurr I am receiving a success code back each time.  I suspect logic apps is only looking at the parent stored proc?

    Is there any way to return the status code or any information from the sub stored proc please?

    Thanks.

    Thursday, March 21, 2019 2:34 AM

All replies

  • Keep in mind, any client, including a Logic App, is completely unaware of anything happening inside the Stored Procedure.  This has always been the case and nothing specific to Logic Apps.

    Is there a way to return the status code...yes, you just have to capture and return it from the parent Stored Procedure as either a Result Set or Out Parameter.

    Start with a TRY...CATCH to set a variable and go from there.

    Thursday, March 21, 2019 12:25 PM
  • You have to use an "OUTPUT" parameter. I think John meant to say this. It functions like an Out parameter in C#. 

    If this answers your question, please use the "Answer" button to say so | Ben Cline

    Friday, March 22, 2019 6:04 PM
  • Hi TRX123456 Any updates on this?
    Monday, March 25, 2019 9:35 PM
    Moderator