Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Biml for Beginners:
Script and Automate
SSIS Development
Cathrine Wilhelmsen
SQLSaturday Chicago · March 17th 2018
Session Description
Are you tired of creating and updating the same SSIS packages again and again? Is your wrist hurting
f...
Biml Basics Tools & Code
SQL and SSIS from Metadata
…the next 60 minutes…
Cathrine Wilhelmsen
@cathrinew cathrinew.net
Data Warehouse & Business Intelligence Consultant
You…
…?
SSIS developer
Easily bored
Tired of repetitive work
Work…
…?
Long development time
Many SSIS packages
Frequent requirement changes
job done!
new standards
…yay
Ever experienced this?
It's time for a change!
What is Biml?
Business Intelligence Markup Language
Easy to read and write XML language
Describes business intelligence ob...
Why use Biml?
SSIS: Plumbing Biml: Business Logic
SSIS: Plumbing
Spend time on dragging, dropping, connecting, aligning
Create the same package over and over again with min...
Biml: Business Logic
Spend time on what is unique in a package
Create a pattern once and reuse for all similar packages
Ha...
Will Biml solve all your challenges?
Probably not...
Biml is a tool for generating SSIS packages
Biml is not a pre-defined...
How can Biml help you?
Biml is great for large projects with common patterns…
Timesaving: Many SSIS packages from one Biml...
What do you need?
BimlExpress
Free add-in for Visual Studio
Code editor with syntax highlighting and Biml Intellisense
More frequent updates...
BimlOnline
Free browser-based Biml editor
Code editor with Biml and C# Intellisense
Reverse-engineer from SSIS to Biml
bim...
BimlStudio
Licensed full-featured development environment for Biml
Visual designer and metadata modeling
Full-stack automa...
How does it work?
…generated packages look exactly like manually created packages
Biml syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Package>
<Pack...
Biml syntax: Root Element
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></...
Biml syntax: Collections of Elements
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyP...
Biml syntax: Elements
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Pack...
Biml syntax: Attributes
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="EmptyPackage1"></Pa...
Biml syntax: Full vs. Shorthand Syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="Empt...
Let's generate
some packages!
Goal: Load from source to staging
Add New Biml File from BimlExpress menu…
…or right-click on SSIS project to Add New Biml File
Biml files are placed under Miscellaneous
Check Biml For Errors from BimlExpress menu…
…or right-click on file to Check Biml For Errors
Generate SSIS Packages from BimlExpress menu…
…or right-click on file to Generate SSIS Packages
From Biml to SSIS: Control Flow
<Package Name="TruncateLoad" ConstraintMode="Linear">
<Tasks>
<ExecuteSQL Name="Truncate T...
From Biml to SSIS: Data Flow
<Transformations>
<OleDbSource Name="Source" ConnectionName="AW2014">
<ExternalTableInput Tab...
.biml vs .dtsx: human-readable vs ALL THE CODE!
(20% zoom)(150% zoom)
Ok, so we can go from Biml to SSIS…
…can we go from SSIS to Biml?
Yes!
Let's convert some packages
from SSIS to Biml!
Convert SSIS to Biml in BimlExpress 2018
Select Package or project…
…import, filter and add to project
The magic is in the…
What is BimlScript?
Extend Biml with C# or VB code blocks
Import database structure and metadata
Loop over tables and colu...
BimlScript Code Blocks
<# … #> Control Block (Control logic)
<#= … #> Text Block (Returns string)
<#@ … #> Directive (Comp...
BimlScript Syntax
<# var con = SchemaManager.CreateConnectionNode(...); #>
<# var metadata = con.GetDatabaseSchema(); #>
<...
BimlScript Syntax: Import metadata
<# var con = SchemaManager.CreateConnectionNode(...); #>
<# var metadata = con.GetDatab...
BimlScript Syntax: Loop over tables
<# var con = SchemaManager.CreateConnectionNode(...); #>
<# var metadata = con.GetData...
BimlScript Syntax: Replace static values
<# var con = SchemaManager.CreateConnectionNode(...); #>
<# var metadata = con.Ge...
Biml vs. BimlScript
Generate, control and
manipulate Biml with C#
XML Language
"Just plain text"
How does it work?
Yes, but how does it work?
Yes, but how does it actually work?
<# foreach (var table in RootNode.Tables) { #>
<Package Name="Load_<#=table.Name#>" />...
Let's generate
many packages!
Of course I can create 200 SSIS Packages!
…what do you need me to do after lunch?
Don't Repeat Yourself
Move code to separate files
Centralize and reuse
Update once for all projects
1. Tiered Biml Files
2...
Tiered Biml Files
What are Tiered Biml Files?
Think of tiers as stacked layers or sequential steps
Tier (Layer) 1
Tier 0
Tier (Layer) 2
Tier...
Tiered Biml Files
Split Biml code in multiple files to:
• Solve logical dependencies
• Build solutions in multiple steps b...
Tiered Biml Files
Biml is compiled step-by-step from lowest to highest tier
• Biml files are implicitly tier 0
• BimlScrip...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Databases
Schemas
Tables
Packages
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Databases
Schemas
Tables
Packages
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databas...
Tiered Biml Files: Behind the Scenes
Connections
Admin
Source
Destination
Databases
Schemas
Tables
Packages
Load_Customer
...
How do you use Tiered Biml Files?
1. Create Biml files with specified tiers
2. Select all the tiered Biml files
3. Right-c...
Annotations
and ObjectTags
Annotations and ObjectTags
Annotations and ObjectTags are Key / Value pairs
Use them to store and pass code between tiers
...
Annotations
Create annotations:
<OleDbConnection Name="Dest">
<Annotations>
<Annotation Tag="Schema">aw</Annotation>
</Ann...
ObjectTags
Create ObjectTags:
RootNode.ObjectTag["Filter"] =
new List<string>{"Product","ProductCategory"};
Use ObjectTags...
Include Files
Include Files
Include common code in multiple files and projects
Can include many file types: .biml .txt .sql .cs
Use the ...
Include Files
Include Files
Include Files
CallBimlScript
CallBimlScript
Works like a parameterized include (or stored procedure)
File to be called (callee) specifies accepted para...
CallBimlScript
CallBimlScript
CallBimlScript
CallBimlScript
CallBimlScript
How does all this work?
Biml Basics Tools & Code
SQL and SSIS from Metadata
…the past 60 minutes…
Where can I learn more?
Free online training
bimlscript.com
Where can I learn more?
cathrinew.net/BimlBook
Get things done
Start small
Start simple
Start with ugly code
Keep going
Expand
Improve
Deliver often
Biml on Monday…
…BimlBreak the rest of the week ☺
@cathrinew
cathrinew.net
linkedin.com/in/cathrinewilhelmsen
hi@cathrinew.net
slideshare.net/cathrinewilhelmsen
Biml resour...
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)
Upcoming SlideShare
Loading in …5
×

of

Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 1 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 2 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 3 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 4 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 5 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 6 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 7 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 8 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 9 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 10 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 11 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 12 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 13 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 14 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 15 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 16 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 17 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 18 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 19 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 20 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 21 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 22 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 23 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 24 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 25 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 26 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 27 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 28 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 29 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 30 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 31 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 32 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 33 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 34 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 35 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 36 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 37 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 38 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 39 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 40 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 41 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 42 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 43 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 44 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 45 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 46 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 47 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 48 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 49 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 50 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 51 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 52 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 53 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 54 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 55 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 56 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 57 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 58 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 59 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 60 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 61 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 62 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 63 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 64 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 65 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 66 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 67 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 68 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 69 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 70 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 71 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 72 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 73 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 74 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 75 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 76 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 77 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 78 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 79 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 80 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 81 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 82 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 83 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 84 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 85 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 86 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 87 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 88 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 89 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 90 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 91 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 92 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 93 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 94 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 95 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 96 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 97 Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) Slide 98
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

2 Likes

Share

Download to read offline

Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)

Download to read offline

Biml for Beginners: Script and Automate SSIS development (Presented at SQLSaturday Chicago on March 17th 2017)

Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)

  1. 1. Biml for Beginners: Script and Automate SSIS Development Cathrine Wilhelmsen SQLSaturday Chicago · March 17th 2018
  2. 2. Session Description Are you tired of creating and updating the same SSIS packages again and again? Is your wrist hurting from all that clicking, dragging, dropping, connecting and aligning? Do you want to take the next step and really speed up your SSIS development? Say goodbye to repetitive work and hello to Biml, the markup language for Business Intelligence projects. In this session we will look at the basics of Biml. First learn how to use Biml to generate SSIS packages from database metadata. Then see how you can reuse code to implement changes in multiple SSIS packages and projects with just a few clicks. Finally, we will create an example project that you can download and start with to speed up your SSIS development from day one. Stop wasting your valuable time on doing the same things over and over and over again, and see how you can complete in a day what once took more than a week!
  3. 3. Biml Basics Tools & Code SQL and SSIS from Metadata …the next 60 minutes…
  4. 4. Cathrine Wilhelmsen @cathrinew cathrinew.net Data Warehouse & Business Intelligence Consultant
  5. 5. You… …? SSIS developer Easily bored Tired of repetitive work
  6. 6. Work… …? Long development time Many SSIS packages Frequent requirement changes
  7. 7. job done! new standards …yay Ever experienced this?
  8. 8. It's time for a change!
  9. 9. What is Biml? Business Intelligence Markup Language Easy to read and write XML language Describes business intelligence objects: • Databases, Schemas, Tables, Views, Columns • SSIS Packages • SSAS Cubes
  10. 10. Why use Biml? SSIS: Plumbing Biml: Business Logic
  11. 11. SSIS: Plumbing Spend time on dragging, dropping, connecting, aligning Create the same package over and over again with minor changes Standards, patterns and templates must be defined up-front Changes must be done in every single package Higher risk of manual errors More packages, more time
  12. 12. Biml: 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 automate and reuse
  13. 13. Will Biml solve all your challenges? Probably not... Biml is a tool for generating SSIS packages Biml is not a pre-defined ETL framework Biml is not a tool for automated deployment ...but it will solve many challenges!
  14. 14. How can Biml help you? Biml is great for large projects with common patterns… Timesaving: Many SSIS packages from one Biml file Reusable: Write once and run on any platform Flexible: Start simple, expand as you learn …but is also useful for smaller projects!
  15. 15. What do you need?
  16. 16. BimlExpress Free add-in for Visual Studio Code editor with syntax highlighting and Biml Intellisense More frequent updates than BIDS Helper varigence.com/bimlexpress
  17. 17. BimlOnline Free browser-based Biml editor Code editor with Biml and C# Intellisense Reverse-engineer from SSIS to Biml bimlonline.com
  18. 18. BimlStudio Licensed full-featured development environment for Biml Visual designer and metadata modeling Full-stack automation and transformers varigence.com/bimlstudio
  19. 19. How does it work? …generated packages look exactly like manually created packages
  20. 20. Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  21. 21. Biml syntax: Root Element <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  22. 22. Biml syntax: Collections of Elements <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  23. 23. Biml syntax: Elements <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  24. 24. Biml syntax: Attributes <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  25. 25. Biml syntax: Full vs. Shorthand Syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="EmptyPackage1"></Package> <Package Name="EmptyPackage2"/> </Packages> </Biml>
  26. 26. Let's generate some packages!
  27. 27. Goal: Load from source to staging
  28. 28. Add New Biml File from BimlExpress menu…
  29. 29. …or right-click on SSIS project to Add New Biml File
  30. 30. Biml files are placed under Miscellaneous
  31. 31. Check Biml For Errors from BimlExpress menu…
  32. 32. …or right-click on file to Check Biml For Errors
  33. 33. Generate SSIS Packages from BimlExpress menu…
  34. 34. …or right-click on file to Generate SSIS Packages
  35. 35. From Biml to SSIS: Control Flow <Package Name="TruncateLoad" ConstraintMode="Linear"> <Tasks> <ExecuteSQL Name="Truncate Table" ConnectionName="Staging"> <DirectInput>TRUNCATE TABLE DestinationTable</DirectInput> </ExecuteSQL> <Dataflow Name="Load Table"> <Transformations>...</Transformations> </Dataflow> </Tasks> </Package>
  36. 36. From Biml to SSIS: Data Flow <Transformations> <OleDbSource Name="Source" ConnectionName="AW2014"> <ExternalTableInput Table="SourceTable" /> </OleDbSource> <DerivedColumns Name="Add LoadDate"> <Columns> <Column Name="LoadDate" DataType="DateTime"> @[System::StartTime] </Column> </Columns> </DerivedColumns> <OleDbDestination Name="Destination" ConnectionName="Staging"> <ExternalTableOutput Table="DestinationTable" /> </OleDbDestination> </Transformations>
  37. 37. .biml vs .dtsx: human-readable vs ALL THE CODE! (20% zoom)(150% zoom)
  38. 38. Ok, so we can go from Biml to SSIS…
  39. 39. …can we go from SSIS to Biml?
  40. 40. Yes!
  41. 41. Let's convert some packages from SSIS to Biml!
  42. 42. Convert SSIS to Biml in BimlExpress 2018
  43. 43. Select Package or project…
  44. 44. …import, filter and add to project
  45. 45. The magic is in the…
  46. 46. What is BimlScript? Extend Biml with C# or VB code blocks Import database structure and metadata Loop over tables and columns Expressions replace static values Generate, control and manipulate Biml code
  47. 47. BimlScript Code Blocks <# … #> Control Block (Control logic) <#= … #> Text Block (Returns string) <#@ … #> Directive (Compiler instructions) <#+ … #> Class Block (Create C# classes) <#* … *#> Comment Block (Comments)
  48. 48. BimlScript Syntax <# var con = SchemaManager.CreateConnectionNode(...); #> <# var metadata = con.GetDatabaseSchema(); #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# foreach (var table in metadata.TableNodes) { #> <Package Name="Load_<#=table.Name#>"></Package> <# } #> </Packages> </Biml>
  49. 49. BimlScript Syntax: Import metadata <# var con = SchemaManager.CreateConnectionNode(...); #> <# var metadata = con.GetDatabaseSchema(); #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# foreach (var table in metadata.TableNodes) { #> <Package Name="Load_<#=table.Name#>"></Package> <# } #> </Packages> </Biml>
  50. 50. BimlScript Syntax: Loop over tables <# var con = SchemaManager.CreateConnectionNode(...); #> <# var metadata = con.GetDatabaseSchema(); #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# foreach (var table in metadata.TableNodes) { #> <Package Name="Load_<#=table.Name#>"></Package> <# } #> </Packages> </Biml>
  51. 51. BimlScript Syntax: Replace static values <# var con = SchemaManager.CreateConnectionNode(...); #> <# var metadata = con.GetDatabaseSchema(); #> <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# foreach (var table in metadata.TableNodes) { #> <Package Name="Load_<#=table.Name#>"></Package> <# } #> </Packages> </Biml>
  52. 52. Biml vs. BimlScript Generate, control and manipulate Biml with C# XML Language "Just plain text"
  53. 53. How does it work?
  54. 54. Yes, but how does it work?
  55. 55. Yes, but how does it actually work? <# foreach (var table in RootNode.Tables) { #> <Package Name="Load_<#=table.Name#>" /> <# } #> <Package Name="Load_Customer" /> <Package Name="Load_Product" /> <Package Name="Load_Sales" />
  56. 56. Let's generate many packages!
  57. 57. Of course I can create 200 SSIS Packages! …what do you need me to do after lunch?
  58. 58. Don't Repeat Yourself Move code to separate files Centralize and reuse Update once for all projects 1. Tiered Biml Files 2. Include Files 3. CallBimlScript
  59. 59. Tiered Biml Files
  60. 60. What are Tiered Biml Files? Think of tiers as stacked layers or sequential steps Tier (Layer) 1 Tier 0 Tier (Layer) 2 Tier (Step) 1 Tier (Step) 2
  61. 61. Tiered Biml Files Split Biml code in multiple files to: • Solve logical dependencies • Build solutions in multiple steps behind the scenes Specify the tier per file by using the template directive: <#@ template tier="2" #>
  62. 62. Tiered Biml Files Biml is compiled step-by-step from lowest to highest tier • Biml files are implicitly tier 0 • BimlScript files are implicitly tier 1 In each tier, objects are added in-memory to RootNode Higher tiers can call RootNode to use objects from lower tiers
  63. 63. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Databases Schemas Tables Packages
  64. 64. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Databases Schemas Tables Packages
  65. 65. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  66. 66. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  67. 67. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  68. 68. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales
  69. 69. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales
  70. 70. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales
  71. 71. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales Master
  72. 72. Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales Master
  73. 73. Tiered Biml Files: Behind the Scenes Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales Master
  74. 74. How do you use Tiered 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
  75. 75. Annotations and ObjectTags
  76. 76. Annotations and ObjectTags Annotations and ObjectTags are Key / Value pairs Use them to store and pass code between tiers Annotations: String / String ObjectTags: String / Object
  77. 77. Annotations Create annotations: <OleDbConnection Name="Dest"> <Annotations> <Annotation Tag="Schema">aw</Annotation> </Annotations> </OleDbConnection> Use annotations: RootNode.OleDbConnections["Dest"].GetTag("Schema");
  78. 78. ObjectTags Create ObjectTags: RootNode.ObjectTag["Filter"] = new List<string>{"Product","ProductCategory"}; Use ObjectTags: RootNode.ObjectTag["Filter"];
  79. 79. Include Files
  80. 80. 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 directive will be replaced by the included file Works like an automated Copy & Paste
  81. 81. Include Files
  82. 82. Include Files
  83. 83. Include Files
  84. 84. CallBimlScript
  85. 85. CallBimlScript Works like a parameterized include (or stored procedure) File to be called (callee) specifies accepted parameters: <#@ property name="Parameter" type="String" #> File that calls (caller) passes parameters: <#=CallBimlScript("Common.biml", Parameter)#>
  86. 86. CallBimlScript
  87. 87. CallBimlScript
  88. 88. CallBimlScript
  89. 89. CallBimlScript
  90. 90. CallBimlScript
  91. 91. How does all this work?
  92. 92. Biml Basics Tools & Code SQL and SSIS from Metadata …the past 60 minutes…
  93. 93. Where can I learn more? Free online training bimlscript.com
  94. 94. Where can I learn more? cathrinew.net/BimlBook
  95. 95. Get things done Start small Start simple Start with ugly code Keep going Expand Improve Deliver often
  96. 96. Biml on Monday… …BimlBreak the rest of the week ☺
  97. 97. @cathrinew cathrinew.net linkedin.com/in/cathrinewilhelmsen hi@cathrinew.net slideshare.net/cathrinewilhelmsen Biml resources and references: cathrinew.net/biml
  • HadiFad

    Mar. 11, 2020
  • NabySow

    May. 18, 2018

Biml for Beginners: Script and Automate SSIS development (Presented at SQLSaturday Chicago on March 17th 2017)

Views

Total views

1,950

On Slideshare

0

From embeds

0

Number of embeds

637

Actions

Downloads

11

Shares

0

Comments

0

Likes

2

×