0% found this document useful (0 votes)
35 views

Lab Topic 9 Extending SSIS Deploying and Configuring SSIS Packages Consuming Data

This document discusses extending SQL Server Integration Services (SSIS) by using scripts and custom components. It covers creating an SSIS catalog, deploying SSIS projects, running packages, and scheduling packages with SQL Server Agent. Specific tasks covered include using scripts in the script task and script component, creating an SSIS catalog, deploying a project, executing a package in SQL Server Management Studio, and scheduling package runs with SQL Server Agent.

Uploaded by

Lai Chun Hou
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Lab Topic 9 Extending SSIS Deploying and Configuring SSIS Packages Consuming Data

This document discusses extending SQL Server Integration Services (SSIS) by using scripts and custom components. It covers creating an SSIS catalog, deploying SSIS projects, running packages, and scheduling packages with SQL Server Agent. Specific tasks covered include using scripts in the script task and script component, creating an SSIS catalog, deploying a project, executing a package in SQL Server Management Studio, and scheduling package runs with SQL Server Agent.

Uploaded by

Lai Chun Hou
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Prepared by Kesavan Krishnan

Lab Topic 9: Extending SQL Server Integration


Services (SSIS), Deploying and Configuring SSIS
Packages, and Consuming Data in a Data
Warehouse

Tasks:
Using Scripts in SSIS, Using Custom Components in SSIS. Creating an
SSIS Catalog, Deploying an SSIS Project, Running an SSIS Package in SQL
Server Management Studio, Scheduling SSIS Packages with, SQL Server
Agent. Exploring an Enterprise BI Solution, Exploring a Self-Service BI
Solution.
Custom Code in SSIS Script Task Basics

There Are Many Pre-Built Tasks Available


▪ Sometimes you need the ability to do something not offered
by the standard tools.
Scripting Allows You To Implement Your Own Code
▪ C# or VB
Two Scripting Tools
▪ Script Task (used in control flow)
▪ Script Component (used in data flow)
Custom Code in SSIS Script Task Basics

▪ You Can Use Any.NET Class Library And Namespace In You


Code
▪ Demo
Custom Code in SSIS Using a Script

Drag the Data Flow Task to the Control Flow.


Custom Code in SSIS Using a Script

Drag OLE DB Source and Flat File Destination. Give a relationship between
both tasks.
Custom Code in SSIS Using a Script

Right click on OLE DB Source, Select the VTCDW as connection manager.


Select SQL command and types as "Select name, birthdate, gender from dimCustomer"
in SQL command text. Check the column and Click OK.
Custom Code in SSIS Using a Script

Right click on Flat File Destination. Select edit and click New and save on
the desktop, and check the mapping. Click OK.
Custom Code in SSIS Using a Script

Under SSIS, click variable. Add a new variable and rename it as "mtlRows".
Custom Code in SSIS Using a Script

Drag the Row Count into Data Flow workplace. Give a relationship between the objects.
Custom Code in SSIS Using a Script

Right click on Row Count and Select mtlRows as a variable. Try to execute
from Data Flow.
Custom Code in SSIS Using a Script

Drag a Script Task into Control Flow and give a link between the two objects.
Right click on Script Task.
Custom Code in SSIS Using a Script

Click on Edit Script.


Custom Code in SSIS Using a Script

Type as - MessageBox.Show(“Done!”);
Click save. Click OK. Try to Execute.
Custom Code in SSIS Using a Script

Add one more Script Task and give a link. Right click and select edit on the second script task.
Custom Code in SSIS Using a Script

Click on ReadOnlyVariables and select the “mtlRows” variable. Click OK.


Click on Edit Script.
Custom Code in SSIS Using a Script

Edit the script as above. Click Save. Click OK. Try to execute.
Custom Code in SSIS Using a Script

Add two more Script Tasks and provide the same link as before. Right click on
Script Task 3, Select as Failure.
Custom Code in SSIS Using a Script

Double click on Script Task 2, and Click on Edit Script.


Custom Code in SSIS Using a Script

Type as above. Click Save. Click OK.


Custom Code in SSIS Using a Script

Double click on Script Task 3, and Click on Edit Script.


Custom Code in SSIS Using a Script

Type as above. Click Save. Click OK. Try to Execute.


Custom Code in SSIS Using a Script

Under the Data Flow, right click and select Edit on OLE DB source.
Custom Code in SSIS Using a Script

Type the SQL command as "Select top 4000 name, bithdate, gender from
dimCustomer“ in SQL command text. Check the column and Click OK. Try to
Execute from Control Flow.
Deploying SSIS Packages

SSIS Packages Are Developed In Isolation From Production


Environments
▪ Development activities must not interfere with business
processes
▪ Production environments have strict security/performance
requirements
Completed Packages Must Be Deployed Into A Production
Environment
Deploying SSIS Packages

Deployment Functionality Is Provided By SSIS


SQL Server 2012 Makes Significant Changes In SSIS Package
Management
▪ Introduces the SSIS Server and SSISDB Catalog
Creating the SSISDB Catalog

SSIS Packages No Longer Depend On The MSDB System


Database
▪ Introducing the SSISDB Catalog
▪ SSIS packages created in earlier versions of SQL Server
must be converted by the SSIS Project Conversion Wizard
to be added to the SSISDB Catalog
The SSISDB Catalog Must Be Created
Creating the SSISDB Catalog

Under Management in Microsoft SQL Server Management Studio,


Right click on Integration Services Catalog, and select Create Catalog.
Creating the SSISDB Catalog

Select on Enable CLR Integration. Give a password. Click OK.


Deploying a Project

Drag Data Flow Task into Control Flow


Deploying a Project

Input OLE DB Source and Flat File Destination. Give a link between them.
Deploying a Project

Add a parameter as above.


Deploying a Project

Right-click AdventureWorksDW2012 in the connection manager and select


Parameterize. Change the property to IntialCatalog. Select Use existing parameters.
Click OK.
Deploying a Project

Under Project, select Deploy.


Deploying a Project

Click on Next. Give the server's name.


Deploying a Project

Under Path, click on Browse. Select SSISDB. Click New Folder.


Give it the name "Parameter Test."Click OK. Click Next. Click Deploy.
Deploying a Project

After deployed and the result showed as “Passed”. Click Close.


Deploying a Project

Under SSISDB in Microsoft SQL Server Management Studio,


can view the new package created.
Executing a Package

Package Execution Can Occur In One Of Two Ways


▪ On-demand
▪ Direct user action
▪ Programmatically
▪ Automated
Executing a Package

On-Demand Execution
▪ Occurs In The SQL Server Management Studio Interface
▪ T-SQL commands
▪ Windows PowerShell
▪ SSIS API
▪ DTExec command-line utility
Executing a Package

On-Demand Execution
▪ NOTE!
▪ DTExecUI cannot be used to execute packages created in SQL
Server 2012; only MSDB based packages
Automated Execution
▪ Package is executed based on a schedule created as part
of a SQL Server Agent job
Executing a Package

Right click on Package, Select Execute. Click OK.


Executing a Package

Click Yes.
Executing a Package

Able to view the overview of the deployed package.


Scheduling a Package

Under SQL Server Agent. Right click on Jobs, Select New Job.
Scheduling a Package

Type "ExecutePackage" as the name. Click on Steps. Click New.


Scheduling a Package

Type "Execute the SSIS Package" as step name.


Select the Type as SQL Server Integration Service Package.
Give the server's name. Click on Package.
Scheduling a Package

Select Package. Click OK.


Scheduling a Package

Under Advanced: Change to “1” in Retry attempts, and “2” in Retry internal (minutes). Click OK.
Scheduling a Package

Under Schedule: Click New. As the name, enter "WeekendSchedule."


Change to Weekly in Occurs option. Select the day as "Recurs every".
Set the time to "occur once at". Click OK. Add one more schedule and change to a
different day and time.
Scheduling a Package

Add one more schedule and change to a different day and time. Click OK. Click OK.
Q&A

Best of luck !!!!

You might also like