don't repeat yourself - an introduction to agile ssis development (24 hours of pass)
TRANSCRIPT
Don't Repeat Yourself
An Introduction to Agile SSIS Development
Cathrine Wilhelmsen
Moderated by Regis Baccaro
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
33
Thank YouPresenting 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
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.$1795until July 12th, 2015
Cathrine Wilhelmsen
5
Data Warehouse Architect and Developer For the Norwegian financial company
Active in the Biml and SQL Server communityPASS Outstanding Volunteer, SQLSaturday Oslo Organizer and
SQL Server User Group Norway Board Member
cathrinewilhelmsen.net
@cathrinew
/in/cathrinewilhelmsen
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
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
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
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
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
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)
21
Biml syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
22
Biml syntax: Root Element
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
23
Biml syntax: Collection of Elements
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
24
Biml syntax: Elements
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
25
Biml syntax: Attributes
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
26
Biml syntax: Full vs. Shorthand Syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
27
Biml files are placed in the Miscellaneous folder
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
28
Right-click on the Biml file to Generate SSIS Packages
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Package Name="EmptyPackage2"/>
</Packages>
</Biml>
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
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)
35
BimlScript syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<# foreach (var table in RootNode.Tables) { #>
<Package Name="Load<#=table.Name#>"></Package>
<# } #>
</Packages>
</Biml>
36
BimlScript syntax: Control Blocks
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<# foreach (var table in RootNode.Tables) { #>
<Package Name="Load<#=table.Name#>"></Package>
<# } #>
</Packages>
</Biml>
37
BimlScript syntax: Expression Control Block
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<# foreach (var table in RootNode.Tables) { #>
<Package Name="Load<#=table.Name#>"></Package>
<# } #>
</Packages>
</Biml>
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
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
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
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
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
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
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!
52
Thank you!
@cathrinew
cathrinewilhelmsen.net
no.linkedin.com/in/cathrinewilhelmsen
cathrinewilhelmsen.net/biml
slideshare.net/cathrinewilhelmsen