SQL Server dataset

We're going to copy some data from our on-premise SQL Server. To create the dataset, we need to create a structure in SQL Server that will be available in ADF. In our case, we'll use an SQL view.

Here is the view code. Execute it on your local SQL Server in SSMS; we'll use it later in the dataset:

CREATE SCHEMA ADFV2Book; 
GO 
CREATE VIEW ADFV2Book.Sales AS 
SELECT        dt.Date, Cust.Customer, Sales.Package, Sales.Description, SUM(Sales.Quantity) AS Quantity, SUM(Sales.[Unit Price]) AS [Unit Price], AVG(Sales.[Tax Rate]) AS [Tax Rate], SUM(Sales.[Total Excluding Tax])  
                         AS [Total Excluding Tax], AVG(Sales.[Tax Amount]) AS [Tax Amount], AVG(Sales.Profit) AS Profit, SUM(Sales.[Total Including Tax]) AS [Total Including Tax] 
FROM            Fact.Sale AS Sales INNER JOIN 
                         Dimension.Customer AS Cust ON Sales.[Customer Key] = Cust.[Customer Key] INNER JOIN 
                         Dimension.Date AS dt ON Sales.[Invoice Date Key] = dt.Date 
GROUP BY dt.Date, Cust.Customer, Sales.Package, Sales.Description; 
GO 

We first create a schema: ADFV2Book. This schema will hold the view Sales created thereafter. Going back to our factory, we'll now create a dataset. From the pipeline section, click on the + sign and choose Dataset from the menu that appears, as shown in the following screenshot:

We'll name the dataset ADFV2Book_Sales. Click on the Connection tab. Set the properties as shown in the following screenshot. Once done, click on Preview data. A window pops up and you can see the first few lines of the view content:

The previous step proved that ADF can access your local server from the cloud.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.39.142