
Answer-first summary for fast verification
Answer: Lookup
## Detailed Explanation For this scenario where you need to execute a Transact-SQL stored procedure that **returns data** (specifically the number of sales invoices for the current date) without requiring input parameters, the **Lookup activity** is the optimal choice. ### Why Lookup Activity (Option D) is Correct: 1. **Designed for Data Retrieval**: The Lookup activity is specifically designed to retrieve data from various sources, including executing queries and stored procedures that return result sets. 2. **Stored Procedure Execution with Output**: According to Azure Data Factory documentation, the Lookup activity can execute stored procedures and return their results, making it suitable for scenarios where you need to capture and use the output of a stored procedure within your pipeline. 3. **Pipeline Integration**: The returned value (number of sales invoices) can be directly used in subsequent pipeline activities for conditional logic, variable assignment, or further processing. ### Why Other Options Are Less Suitable: - **Stored Procedure Activity (Option A)**: While this activity can execute stored procedures, it's primarily designed for stored procedures that perform operations (INSERT, UPDATE, DELETE) rather than those that return data. The Stored Procedure activity doesn't effectively capture and make available the output of stored procedures for use in the pipeline. - **Get Metadata Activity (Option B)**: This activity is designed to retrieve metadata information about datasets (file names, sizes, last modified dates, etc.), not to execute stored procedures or retrieve business data like invoice counts. - **Append Variable Activity (Option C)**: This activity is used to modify existing pipeline variables by appending values to them, not for executing stored procedures or retrieving data from databases. ### Best Practice Consideration: When a stored procedure's primary purpose is to return data that needs to be used within the pipeline workflow, the Lookup activity provides the most straightforward and effective approach, as it captures the result set and makes it available for downstream processing.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are creating an Azure Data Factory pipeline and need to add an activity that executes a Transact-SQL stored procedure. The stored procedure returns the number of sales invoices for the current date and does not require any input parameters.
Which activity type should you use?
A
Stored Procedure
B
Get Metadata
C
Append Variable
D
Lookup
No comments yet.