Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS) (Presented at 24 HOurs of PASS Growing Our Community Edititon on June 25th 2015)
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)
1. Don't Repeat Yourself
An Introduction to Agile SSIS Development
Cathrine Wilhelmsen
Moderated by Regis Baccaro
2. 2
Technical Assistance
2
Maximize your screen
with the zoom button
on the top of the
presentation window
Type your questions in
the question pane on
the right side
3. 3
3
Thank You Presenting Sponsors
Supporting Sponsors
Gain insights through familiar
tools while balancing monitoring
and managing user created
content across structured and
unstructured sources.
Unifying computer, storage,
networking, and virtualization, Cisco
UCS is the optimal database and
business intelligence platform for SQL
Server.
Solutions from Dell help you
monitor, manage, protect and
improve your SQL Server
environment.
www.microsoft.com www.cisco.com www.software.dell.com
4. Planning on attending PASS Summit 2015? Start saving
today!
• The world’s largest gathering of SQL Server & BI professionals
• Take your SQL Server skills to the next level by learning from the world’s SQL
Server experts, in over 190 technical sessions
• Over 5000 attendees, representing 2000 companies, from 52 countries,
ready to network & learn
Contact your Local or Virtual Chapter for an
additional $150 discount.
$1795
until July 12th, 2015
5. Cathrine Wilhelmsen
5
Data Warehouse Architect and Developer
For the Norwegian financial company
Active in the Biml and SQL Server community
PASS Outstanding Volunteer, SQLSaturday Oslo Organizer and
SQL Server User Group Norway Board Member
cathrinewilhelmsen.net
@cathrinew
/in/cathrinewilhelmsen
7. 7
Session Description
SSIS (SQL Server Integration Services) is a powerful tool for extracting, transforming
and loading data, but creating and maintaining a large number of SSIS packages can
be both tedious and time-consuming. Even if you use templates and follow best
practices you often have to repeat the same steps over and over again. Handling
metadata and schema changes is a manual process, and there are no easy ways to
implement new requirements in multiple packages at the same time.
It is time to bring the Don't Repeat Yourself (DRY) software engineering principle to
SSIS projects. First learn how to use Biml (Business Intelligence Markup Language)
and BimlScript to generate SSIS packages from database metadata and implement
changes in all those packages with just a few clicks. Then take the DRY principle one
step further and learn how to update all packages in multiple projects by separating and
reusing common code. See how Biml allows you to complete in a day what once took
more than a week!
7
8. 8
Who are you?
SSIS and ETL developer?
Easily bored?
Tired of repetitive work?
8
13. 13
Traditional SSIS: Plumbing
Time wasted on dragging, dropping, connecting, aligning
Create the same package over and over and over again with just a few changes
Standards, patterns and templates must be defined up-front
Changes must be done in every single package
High risk of manual errors
More packages, more time
13
14. 14
Agile SSIS: Business Logic
Spend time on what is unique in a package
Create a pattern once and reuse for all similar packages
Handle scope and requirement changes quickly and easily
Changes can be applied to all packages at once
Lower risk of manual errors
Longer time to start, but then reuse and scale
14
15.
16. 16
Will Biml solve all your problems?
Probably not...
Biml is a tool for generating SSIS packages
Biml is not a pre-defined data warehouse framework
Biml is not a tool for automated deployment
...but it will solve many problems!
16
17. 17
How can Biml help you?
Timesaving: Many SSIS Packages from one Biml file
Reusable: Write once and run on any platform
Flexible: Start simple, expand as you learn
17
18. 18
What is Business Intelligence Markup Language?
Easy to read and write XML dialect
Specifies business intelligence objects
Databases, schemas, tables, columns
SSIS packages
SSAS cubes, facts, dimensions (not in free version)
31. 31
.biml vs .dtsx: human-readable vs ALL THE CODE!
31
(150% zoom) (20% zoom)
32.
33. 33
The magic is in the
Extend Biml with C# or VB.NET code blocks
Import database structure and metadata
Loop over tables and columns
Add expressions to replace static values
Allows you to control and manipulate Biml code
34. 34
BimlScript code blocks
<#@ … #> Directives (Instructions to the BimlCompiler)
<# … #> Control Blocks (Control logic)
<#= … #> Expression Control Blocks (Replace block with string value)
<#+ … #> Class Feature Control Blocks (Create helper methods)
40. 40
Yes, but how does it actually work?
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<# foreach (var table in RootNode.Tables) { #>
<Package Name="Load<#=table.Name#>"></Package>
<# } #>
</Packages>
</Biml>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="LoadCustomer"></Package>
<Package Name="LoadProduct"></Package>
<Package Name="LoadSales"></Package>
</Packages>
</Biml>
41. 41
Don't Repeat Yourself
Move common code to separate files
Centralize and reuse in many projects
Update code once for all projects
1. Split and combine Biml files
2. Include files
3. CallBimlScript with parameters
42. 42
Don't Repeat Yourself: Split and combine Biml files
Solve logical dependencies and simulate manual workflows by using tiers
Tiers instruct the BimlCompiler to compile files from lowest to highest tier
<#@ template tier="1" #>
Higher tiers can use and might depend on objects from lower tiers
Tier 1 - Create database connections
Example: Tier 2 - Create loading packages
Tier 3 - Create master package to execute loading packages
43. 43
Split and combine multiple Biml files
1. Create Biml files with specified tiers
2. Select all the tiered Biml files
3. Right-click and click Generate SSIS Packages
1
2
3
44. 44
Don't Repeat Yourself: Include files
Include common code in multiple files and projects
Can include many file types: .biml .txt .sql .cs
Use the include directive
<#@ include file="CommonCode.biml" #>
The include directive will be replaced by the content of the included file
Include pulls code from the included file into the main file
46. 46
Don't Repeat Yourself: CallBimlScript with parameters
Works like a parameterized include
File to be called (callee) specifies the input parameters it accepts
<#@ property name="Table" type="AstTableNode" #>
File that calls (caller) passes input parameters
<#=CallBimlScript("CommonCode.biml", Table)#>
CallBimlScript pushes parameters from the caller to the callee, and
the callee returns code
50. 50
What do you do next?
1. Download BIDS Helper
2. Identify your SSIS patterns
3. Rewrite one SSIS package to Biml
(Not possible to reverse-engineer SSIS to Biml in BIDS Helper)
4. Expand with BimlScript
5. Separate and reuse common Biml code
6. ...never look back to the days of drag&drop
7. Get involved in the SQL Server and Biml community!