Loop through Multiple Stored Procedures with Parameters & Generate Files Dynamically in Data Factory

Loop through Multiple Stored Procedures with Parameters & Generate Files Dynamically in Data Factory

How to Loop through Multiple Stored Procedures with Parameters & Generate Files Dynamically in Azure Data Factory Tutorial 2021, in this video we are going to learn How to Loop through Multiple Stored Procedures with Parameters & Generate Files Dynamically in Azure Data Factory ADF Tutorial 2021, Azure Data Factory Step by Step - ADF Tutorial 2021 - ADF Tutorial 2021 Step by Step ADF Tutorial - Azure Data Factory Tutorial 2021.

Script used in the video.

create table dbo.SPList(Id int,
SPName varchar(100),
SPparameter varchar(100),
SPpValue varchar(100),
FileName varchar(100))

Select * from dbo.SPList
truncate table dbo.SPList


insert into dbo.SPList values
(1,'sp_Order ','@Region,@Country','Asia'',''Pakistan','Order'),
(2,'dbo.sp_Product ','@ProductName','Laptop','Product')

Select * from dbo.SPList

Select 'EXEC '+spname+ ' '''+SPpValue+''''
AS SP,FileName+'_'+Cast(Cast(getdate() as date) as
varchar(100)) as FileName from dbo.SPList


EXEC sp_Order 'Asia','Pakistan' Order_2021-08-31
EXEC dbo.sp_Product 'Laptop' Product_2021-08-31

Stored procedures definition
create procedure dbo.sp_Product
@ProductName varchar(100)
as
begin
Select * from dbo.Product where ProductName=@ProductName
End

Create procedure dbo.sp_Order
@Region varchar(100),
@Country varchar(100)
as
BEGIN
Select * from dbo.[Order]
where Region=@Region
and Country=@Country
End


Order table definition
CREATE TABLE [dbo].[Order](
[id] [nvarchar](max) NULL,
[SalePersonFName] [nvarchar](max) NULL,
[SalePersonLName] [nvarchar](max) NULL,
[ProductName] [nvarchar](max) NULL,
[ItemsSold] [nvarchar](max) NULL,
[SoldPrice] [nvarchar](max) NULL,
[SoldDate] [nvarchar](max) NULL,
[City] [nvarchar](max) NULL,
[State] [nvarchar](max) NULL,
[Country] [nvarchar](max) NULL,
[Region] [nvarchar](max) NULL
)


Product Table definition
CREATE TABLE [dbo].[Product](
[ProductId] [nvarchar](max) NULL,
[ProductName] [nvarchar](max) NULL
)

Azure Data Factory Tutorial for beginners
Azure Data Factory Tutorial 2021
Step by step Azure Data Factory Tutorial
Real-time Azure Data Factory Tutorial
Scenario base training on Azure Data Factory
Best ADF Tutorial on youtube

#AzureDataFactory #ADFTutorial2021

TechbrothersITData Factory tutorial for beginnersBest Azure Data Factory tutorial 2021 on youtube

Post a Comment

0 Comments