This example demonstrates how to invoke a stored procedure in an Azure SQL Database using the Azure SQL - Stored Procedure Snap. An upstream Snap passes an employee ID as an input parameter, and the Snap executes the stored procedure and returns matching records in its result set output view.
Download this Pipeline
-
Create the stored procedure in the Azure SQL Database. For example:
CREATE PROCEDURE Emp_Select_2 ( @emp_id INT )
AS BEGIN
SELECT * FROM dbo.Emp_Details WHERE emp_id = @emp_id
END
-
Configure an upstream Snap (for example, a JSON Generator or Mapper Snap) to pass the employee ID as input to the Azure SQL - Stored Procedure Snap.
-
Configure the Azure SQL - Stored Procedure Snap: set Schema Name to dbo, set Stored Procedure Name to Emp_Select_2, and map the input parameter to the Parameter Values field in the order defined by the stored procedure.
-
Execute the pipeline. The Snap produces two output views:
- Output parameters: Returns an empty map when no OUT parameters are defined.
- Result set: Returns the employee record(s) matching the provided ID.
To reuse the example pipelines:
- Download and import the SLP file into your Environment.
- Configure Snap accounts.
- Provide Pipeline parameters, if any.