Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save Data factory stored procedure output

Whenever I execute a stored procedure in the ADFv2, it gives me an output as

{
    "effectiveIntegrationRuntime": "DefaultIntegrationRuntime (Australia Southeast)",
    "executionDuration": 34 
}

even though I have set 2 variables as output in the procedure. Is there any way to map the output of the stored procedure in the ADFv2? Till now I can map the output of all the other activities but not of Stored procedures.

like image 835
Gagan Avatar asked Jul 14 '18 12:07

Gagan


People also ask

How do you save an Azure data factory?

On the Edit trigger page, review the warning, and then select Save. The pipeline in this example doesn't take any parameters. Click Publish all to publish the change. Go to the Monitor tab on the left to see the triggered pipeline runs.

How do you use lookup activity output in Azure data Factory?

Search for Lookup in the pipeline Activities pane, and drag a Lookup activity to the pipeline canvas. Select the new Lookup activity on the canvas if it is not already selected, and its Settings tab, to edit its details. Choose an existing source dataset or select the New button to create a new one.

What is stored procedure activity in Azure data Factory?

You use data transformation activities in a Data Factory or Synapse pipeline to transform and process raw data into predictions and insights. The Stored Procedure Activity is one of the transformation activities that pipelines support.

Can stored procedure have output parameter?

A Stored Procedure can have any number of output parameters. The simple logic is this — If you want to return 1 value then use 1 output parameter, for returning 5 values use 5 output parameters, for 10 use 10, and so on.


2 Answers

Stored procedure call in Data factory (v2) does not capture the result data set. So you cannot use the stored procedure activity to get the result data set and refer it in next activities. Workaround is to use lookup activity to call exact same stored procedure as lookup will get you the result data set from stored procedure. Replace your Stored procedure activity with lookup and it will work.

like image 120
Suraj Somani Avatar answered Oct 28 '22 18:10

Suraj Somani


You could use a lookup activity to get the result. Please reference this post. https://social.msdn.microsoft.com/Forums/azure/en-US/82e84ec4-fc40-4bd3-b6d5-b742f3cd1a33/adf-v2-how-to-check-if-stored-procedure-output-is-empty?forum=AzureDataFactory

Update by Gagan: Instead of getting the output of SP (which is not possible in ADFv2 right now), I stored the output in the table and then apply lookup-foreach to the table to get the value.

like image 23
Fang Liu Avatar answered Oct 28 '22 19:10

Fang Liu