How to declare variable in stored procedure activity in adf

Data Engineer 1 Reputation point
2022-03-23T20:19:06.847+00:00

Hello, I'm trying to insert error message from any activity to SQL table (sno, pipelinename, errormessage) by using parameters with Stored procedure
But generated error message is not inserting in SQL table because not having ' ' (single cotations)
Some one said me declare variable for that column
Now i don't know how to declare variable for stored procedure activity while calling Stored procedure activity

Please answer me

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

1 answer

Sort by: Most helpful
  1. Pratik Somaiya 4,211 Reputation points Volunteer Moderator
    2022-03-24T04:14:58.94+00:00

    Hello @Data Engineer

    You can pass a variable to a stored procedure by clicking New under the Stored Procedure Parameter option of the stored procedure activity, there you can pass variable name, it's data type and value

    186250-image.png

    In your case, the value should be the error message of the activity you are using

    For ex, if you are using a Copy activity with name Copy_Data then your value would be

    @activity('CopyData').output.errors[0].Message

    1 person found this answer helpful.
    0 comments No comments

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.