Exam DP-203 All QuestionsBrowse all questions from this exam
Question 244

You are creating an Azure Data Factory pipeline.

You need to add an activity to the pipeline. The activity must execute a Transact-SQL stored procedure that has the following characteristics:

• Returns the number of sales invoices for a current date

• Does NOT require input parameters

Which type on activity should you use?

    Correct Answer: A

    To execute a Transact-SQL stored procedure within an Azure Data Factory pipeline, you should use the 'Stored Procedure' activity. The 'Stored Procedure' activity is specifically designed to run SQL stored procedures, making it the appropriate choice when you need to execute a stored procedure and handle its results. 'Get Metadata' is used to retrieve metadata from data stores, 'Append Variable' is used to append values to variables, and 'Lookup' is primarily used to retrieve specific data, not to execute stored procedures.

Discussion
AlongiOption: D

The Stored Procedure Activity does not allow to return an output, so Lookup is the correct one. Refer to: https://learn.microsoft.com/en-us/azure/data-factory/transform-data-using-stored-procedure

fahfouhi94Option: D

When the stored procedure has Output parameters, instead of using stored procedure activity, use lookup acitivty and Script activity. Stored procedure activity does not support calling SPs with Output parameter yet.

JamieMcDOption: D

Also ChatGPT: For your specific requirement: Retrieve the Number of Sales Invoices for the Current Date: If you simply need to call a stored procedure that returns the count and you want to use this count directly in your pipeline (e.g., for further processing or branching logic), the Lookup activity is preferable. If the stored procedure's primary purpose is to perform operations (e.g., insert/update/delete) and the output is not directly needed within the pipeline, the Stored Procedure activity is more appropriate. Given that your stored procedure returns the number of sales invoices and does not require input parameters, and assuming you want to use this count directly in the pipeline, the Lookup activity would be a good fit.

tadenetOption: A

Chatgpt: The Stored Procedure activity in Azure Data Factory is specifically designed to execute SQL stored procedures. It is the most suitable activity when you need to run a stored procedure and handle the results or output of that procedure. The other options do not fit the requirements: B. Get Metadata is used to retrieve metadata information from data stores, not to execute stored procedures. C. Append Variable is used to append a value to an existing variable, not for executing stored procedures. D. Lookup is used to retrieve a dataset from a data store but is not typically used to execute stored procedures that return a single value without parameters.