Running a Stored Procedure for Multiple Dataflow Activities or notebooks

Aditya Singh 105 Reputation points
2024-04-11T14:31:12.2133333+00:00

How do I run a single stored procedure multiple times in an Azure Pipeline for multiple dataflow activities? I'm having trouble figuring out the best way to do this.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,431 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,382 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,570 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 30,911 Reputation points Microsoft Employee
    2024-04-12T02:38:08.1466667+00:00

    Hi Aditya Singh ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query here.

    As per my understanding you are trying to call multiple stored procedure within dataflow via ADF pipeline. Could you please explain the need to run the stored procedure via dataflow or notebook, when ADF has "Stored procedure" activity specifically to execute the Stored procs.

    You could consider leveraging stored procedure activity in ADF pipeline to execute stored procedure. In order to run multiple stored procedures, you can follow the below steps:

    • Create a control table in the Az SQL DB which contains the list of all stored procedures to be called along with the storing the list of input parameters. Point to the control table via lookup activity.
    • Use Foreach activity to loop through the lookup output, taking each SP name for each iterations.
    • Inside foreach, call stored procedure activity and use 'add dynamic content' to pass the SP name with expression , eg: @item().SPName

    In case you want to call the SP within dataflow, then instead of stored procedure activity, use dataflow activity and pass the SP names dynamically for each iteration as a parameter to the dataflow .

    Hope it helps. Kindly accept the answer by clicking on Accept answer button. If you have any further query, kindly let us know. Thankyou.

    0 comments No comments