Рет қаралды 4,137
How to Read JSON resultSets Output Generated by Script Activity in Azure Data Factory | ADF Tutorial 2022, in this video we are going to learn How to Read JSON resultSets Output Generated by Script Activity in Azure Data Factory ADF Tutorial 2022, Azure Data Factory Step by Step - ADF Tutorial 2022 - ADF Tutorial 2022 Step by Step ADF Tutorial - Azure Data Factory Tutorial 2022.
Script used in the video
/****** Object: Table [dbo].[TotalSaleRegional] Script Date: 3/17/2022 10:37:30 AM ******/
CREATE TABLE [dbo].[TotalSaleRegional](
[id] [int] NOT NULL,
[SalePersonFName] [varchar](100) NULL,
[SalePersonLName] [varchar](100) NULL,
[ProductName] [varchar](100) NULL,
[ItemsSold] [int] NULL,
[SoldPrice] [float] NULL,
[SoldDate] [date] NULL,
[City] [varchar](100) NULL,
[State] [varchar](100) NULL,
[Country] [varchar](100) NULL,
[Region] [varchar](100) NULL
) ON [PRIMARY]
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (1, N'Aamir', N'Shahzad', N'TV', 1, 700, CAST(N'2015-07-15' AS Date), N'Charlotte', N'NC', N'USA', N'North America')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (2, N'M', N'Raza', N'Cell Phone', 2, 800, CAST(N'2015-07-15' AS Date), N'Charlotte', N'NC', N'USA', N'North America')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (3, N'Christy ', N'Ladson', N'TV', 3, 1600, CAST(N'2015-04-02' AS Date), N'High Point', N'NC', N'USA', N'North America')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (4, N'John', N'Rivers', N'Laptop', 5, 2400, CAST(N'2014-03-09' AS Date), N'Jersey City', N'NJ', N'USA', N'North America')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (5, N'Najaf', N'Ali', N'Computer', 1, 300, CAST(N'2015-06-20' AS Date), N'Karachi', N'Sindh', N'Pakistan', N'Asia')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (6, N'Sukhjeet', N'Singh', N'TV', 2, 900, CAST(N'2015-06-21' AS Date), N'ChandiGar', N'Punjab', N'India', N'Asia')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (7, N'Chirag', N'Patel', N'Cell Phone', 5, 1500, CAST(N'2015-06-23' AS Date), N'AhmadAbad', N'Gujrat', N'India', N'Asia')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (8, N'Aleena', N'Aman', N'Laptop', 2, 800, CAST(N'2015-05-25' AS Date), N'Lahore', N'Punjab', N'Pakistan', N'Asia')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (9, N'Petra', N'Henry', N'TV', 10, 5000, CAST(N'2015-04-08' AS Date), N'Paris', N'Île-de-France', N'France', N'Europe')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (10, N'Rita', N'Roger', N'Laptop', 7, 2100, CAST(N'2015-04-11' AS Date), N'Paris', N'Île-de-France', N'France', N'Europe')
GO
INSERT [dbo].[TotalSaleRegional] ([id], [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region]) VALUES (11, N'Tamara', N'Tony', N'Cell Phone', 2, 1200, CAST(N'2015-03-03' AS Date), N'Frankfurt', N'Hesse', N'Germany', N'Europe')
--Select Query to select data in Script Activity in Azure Data Factory
Select distinct SalePersonFName,SalePersonLName,Region From [dbo].[TotalSaleRegional]
where id in (1,2)
--Expressions used in Video to read data from resulSets.rows array.
@activity('Script1').output.resultSets[0].rows
@activity('Script1').output.resultSets[0]['rows']
Azure Data Factory Tutorial for beginners
Azure Data Factory Tutorial 2022
Step by step Azure Data Factory Tutorial
Real-time Azure Data Factory Tutorial
Scenario-based training on Azure Data Factory
Best ADF Tutorial on youtube