How to Pass JSON Data from Azure Blob to On-Prem SQL Server Stored Procedure and Capture Error Messages?

Rishikesh S Darwade 0 Reputation points
2025-02-16T08:12:44.86+00:00

There is a requirement, where there is an Stored Procedure in On Prem SQL Server which return a table with errors/successfully processed records.

The SP is inserting the records provided to it via table type parameter.

I am having the data in Azure blob storage as JSON file and want to pass that to the Stored Procedure as table type parameter. I am currently doing this using Copy Data Activity but problem is in case of any errors, which SP returns, I am unable to grab those error messages and log those errors.

Could anyone suggest a solution for this scenario using Azure Data Factory (ADF) only, as I want to avoid involving any other dependencies?

Source :
User's image

SP :

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,272 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Achraf Ben Alaya 1,226 Reputation points MVP
    2025-02-16T12:46:45.43+00:00

    Hi ,

    you can :

    1- Capture error information by modifying your procedure to return error details ,liek a status or error message , you can use it as output

    2-Log Errors in ADF : use ADF output Dataset to capture the results , you can use lookup activity or stored procedure acitivity to capture the results .

    3- in your pipline you can use copy data acitivity to load the data from the blob into a temporary staging table ,once it's in the staging table you can pass it to the stored procedure as a table-valued paramter .

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.