Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)

Cathrine Wilhelmsen
Cathrine WilhelmsenData & Analytics Solutions Architect in Evidi | Microsoft Data Platform MVP
Level Up Your Biml:
Best Practices and
Coding Techniques
Cathrine Wilhelmsen · SQLBits · Feb 24th 2018
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Session Description
Is your Biml solution starting to remind you of a bowl of tangled spaghetti code? Good! That
means you are solving real problems while saving a lot of time. The next step is to make sure
that your solution does not grow too complex and confusing – you do not want to waste all that
saved time on future maintenance!
Attend this session for an overview of Biml best practices and coding techniques. Learn how to
centralize and reuse code with Include files and the CallBimlScript method. Make your code
easier to read and write by utilizing LINQ (Language-Integrated Queries). Share code between
files by using Annotations and ObjectTags. And finally, if standard Biml is not enough to solve
your problems, you can create your own C# helper classes and extension methods to implement
custom logic.
Start improving your code today and level up your Biml in no time!
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Cathrine Wilhelmsen
@cathrinew cathrinew.net
Data Warehouse & Business Intelligence Consultant
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
You…
…?
Know basic Biml and BimlScript
Created a staging environment using Biml
Created a metadata-driven Biml framework
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
…the next 60 minutes…
Practical Biml Coding C# Classes and Methods
Code Management
Biml and
BimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Biml vs. BimlScript
XML Language
"Just plain text"
Generate, control and
manipulate Biml with C#
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Biml
Biml is an XML language – it's just plain text
Easy to read and write – but can be verbose
You probably don't want to write 50000 lines of
Biml code manually...?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Generating Biml
You can use any tool to generate Biml for you:
• Text editor macros
• Excel
• PowerShell
• T-SQL
…but the recommended tool is BimlScript :)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Extend Biml with C# or VB code blocks
Import database structure and metadata
Loop over tables and columns
Expressions replace static values
Allows you to generate, control and manipulate Biml code
What is BimlScript?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
BimlScript Code Blocks
<# … #> Control Block (Control logic)
<#= … #> Text Block (Returns string)
<#@ … #> Directive (Compiler instructions)
<#+ … #> Class Block (Create C# classes)
<#* … *#> Comment Block (Comments)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
How does it work?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Yes, but how does it work?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Yes, but how does it actually work?
<# foreach (var table in metadata.TableNodes) { #>
<Package Name="Load_<#=table.Name#>"></Package>
<# } #>
<Package Name="Load_Customer"></Package>
<Package Name="Load_Product"></Package>
<Package Name="Load_Sales"></Package>
Biml Tools
Comparison
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
What do you need?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
BimlExpress
Free add-in for Visual Studio
Code editor with syntax highlighting and Biml Intellisense
Preview expanded / compiled Biml
http://varigence.com/bimlexpress
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
BimlOnline
Free browser-based Biml editor
Code editor with Biml and C# Intellisense
Reverse-engineer from SSIS to Biml
http://bimlonline.com
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
BimlStudio
Licensed full-featured development environment for Biml
Visual designer and metadata modeling
Full-stack automation and transformers
http://varigence.com/bimlstudio
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Biml Tools Comparison
Licensed
IDE replaces VS
Full Automation
Free
Biml intellisense
Preview Pane
Free
Full intellisense
Package Import
Code
Management
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Don't Repeat Yourself
Centralize and reuse code
Update code once in one file
1. Tiered Biml Files
2. Include Files
3. CallBimlScript
Tiered Biml Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files
Split Biml code in multiple files to:
• Solve logical dependencies
• Build solutions in multiple steps
Specify tier per file by using the template directive:
<#@ template tier="2" #>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files
Biml is compiled 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 call RootNode to use objects from lower tiers
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Databases
Schemas
Tables
Packages
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Databases
Schemas
Tables
Packages
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databases
Schemas
Tables
Packages
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databases
Schemas
Tables
Packages
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Load Packages
Master Package
Connections
Admin
Source
Destination
Databases
Schemas
Tables
Packages
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Tiered Biml Files: Behind the Scenes
Connections
Admin
Source
Destination
Databases
Schemas
Tables
Packages
Load_Customer
Load_Product
Load_Sales
Master
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Include Files
Global Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Global Include Files
Use the global directive
<#@ global #>
Use instead of adding include directive to all files to
• Create global variables
• Include code files
• Make VB default language
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Global Include Files
Specify directive attributes to control global include files
<#@ global
order="1"
location="top"
active="true"
applytocallbimlscript="false" #>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Global Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Global Include Files
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
How do you use Global Include Files?
1. Create Global Include File
2. Select Biml files and Global Include File
3. Right-click and click Generate SSIS Packages
1
2
3
CallBimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
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("Callee.biml", Parameter)#>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScript
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScript
CallBimlScriptWithOutput
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput: Callee
Callee specifies parameters and custom output:
<#@ property name="Parameter" type="String" #>
<# CustomOutput.BimlComment = "Comment"; #>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput: Caller
Caller creates, passes and uses custom output:
<# dynamic outObj; #>
<#=CallBimlScriptWithOutput("Callee.biml",
out outObj)#>
<#=outObj.BimlComment#>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
CallBimlScriptWithOutput
use CustomOutput
DEMO
Code Management
Practical
Biml Coding
Annotations and ObjectTags
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Annotations and ObjectTags
Annotations and ObjectTags are Key / Value pairs
Used to store and pass metadata between Biml files
Annotations: String / String
ObjectTags: String / Object
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Annotations
Create annotations:
<OleDbConnection Name="Dest" ConnectionString="…">
<Annotations>
<Annotation Tag="Schema">stg</Annotation>
</Annotations>
</OleDbConnection>
Use annotations:
RootNode.OleDbConnections["Dest"].GetTag("Schema");
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
ObjectTags
Create ObjectTags:
RootNode.ObjectTag["Filter"] =
new List<string>{"Product","ProductCategory"};
Use ObjectTags:
var FilterList =
(List<string>)RootNode.ObjectTag["Filter"];
LINQ
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ (Language-Integrated Query)
One language to query:
SQL Server Databases
Datasets
Collections
Two ways to write queries:
SQL-ish Syntax
Extension Methods
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ Extension Methods
Sort
OrderBy, ThenBy
Filter
Where, OfType
Group
GroupBy
Aggregate
Count, Sum
Check Collections
All, Any, Contains
Get Elements
First, Last, ElementAt
Project Collections
Select, SelectMany
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ Extension Methods Example
var numConnections = RootNode.Connections.Count()
foreach (var table in RootNode.Tables.Where(…))
if (RootNode.Packages.Any(…))
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ Extension Methods Example
foreach (var table in RootNode.Tables.Where(…))
if (RootNode.Packages.Any(…))
But what do you put in here?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
"A lambda expression is an anonymous
function that you can use to create
delegates or expression tree types"
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
…huh? o_O
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
table => table.Name == "Product"
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
table => table.Name == "Product"
The arrow is the lambda operator
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
table => table.Name == "Product"
Input parameter is on the left side
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
table => table.Name == "Product"
Expression is on the right side
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Lambda Expressions
table => table.Name == "Product"
For each object in collection, evaluate expression
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ and Lambda
Chain LINQ Methods and use Lambda Expressions for
simple and powerful querying of collections:
.Where(table => table.Schema.Name == "Production")
.OrderBy(table => table.Name)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Filter collections
Where()
Returns the filtered collection with all elements that meet the criteria
RootNode.Tables.Where(t => t.Schema.Name == "Production")
OfType()
Returns the filtered collection with all elements of the specified type
RootNode.Connections.OfType<AstExcelOleDbConnectionNode>()
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Sort collections
OrderBy()
Returns the collection sorted by key…
RootNode.Tables.OrderBy(t => t.Name)
ThenBy()
…then sorted by secondary key
RootNode.Tables.OrderBy(t => t.Schema.Name)
.ThenBy(t => t.Name)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Sort collections
OrderByDescending()
Returns the collection sorted by key…
RootNode.Tables.OrderByDescending(t => t.Name)
ThenByDescending()
…then sorted by secondary key
RootNode.Tables.OrderBy(t => t.Schema.Name)
.ThenByDescending(t => t.Name)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Sort collections
Reverse()
Returns the collection sorted in reverse order
RootNode.Tables.Reverse()
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Group collections
GroupBy()
Returns a collection of key-value pairs where each value is a new collection
RootNode.Tables.GroupBy(t => t.Schema.Name)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Aggregate collections
Count()
Returns the number of elements in the collection
RootNode.Tables.Count()
RootNode.Tables.Count(t => t.Schema.Name == "Production")
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Aggregate collections
Sum()
Returns the sum of the (numeric) values in the collection
RootNode.Tables.Sum(t => t.Columns.Count)
Average()
Returns the average value of the (numeric) values in the collection
RootNode.Tables.Average(t => t.Columns.Count)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Aggregate collections
Min()
Returns the minimum value of the (numeric) values in the collection
RootNode.Tables.Min(t => t.Columns.Count)
Max()
Returns the maximum value of the (numeric) values in the collection
RootNode.Tables.Max(t => t.Columns.Count)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Check collections
All()
Returns true if all elements in the collection meet the criteria
RootNode.Databases.All(d => d.Name.StartsWith("A"))
Any()
Returns true if any element in the collection meets the criteria
RootNode.Databases.Any(d => d.Name.Contains("DW"))
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Check collections
Contains()
Returns true if collection contains element
RootNode.Databases.Contains(AdventureWorks2014)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Get elements
First()
Returns the first element in the collection (that meets the criteria)
RootNode.Tables.First()
RootNode.Tables.First(t => t.Schema.Name == "Production")
FirstOrDefault()
Returns the first element in the collection or default value (that meets the criteria)
RootNode.Tables.FirstOrDefault()
RootNode.Tables.FirstOrDefault(t => t.Schema.Name == "Production")
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Get elements
Last()
Returns the last element in the collection (that meets the criteria)
RootNode.Tables.Last()
RootNode.Tables.Last(t => t.Schema.Name == "Production")
LastOrDefault()
Returns the last element in the collection or default value (that meets the criteria)
RootNode.Tables.LastOrDefault()
RootNode.Tables.LastOrDefault(t => t.Schema.Name == "Production")
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Get elements
ElementAt()
Returns the element in the collection at the specified index
RootNode.Tables.ElementAt(42)
ElementAtOrDefault()
Returns the element in the collection or default value at the specified index
RootNode.Tables.ElementAtOrDefault(42)
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Project collections
Select()
Creates a new collection from one collection
A list of table names:
RootNode.Tables.Select(t => t.Name)
A list of table and schema names:
RootNode.Tables.Select(t => new {t.Name, t.Schema.Name})
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
LINQ: Project collections
SelectMany()
Creates a new collection from many collections and merges the collections
A list of all columns from all tables:
RootNode.Tables.SelectMany(t => t.Columns)
DEMO
Practical
Biml Coding
Classes
and Methods
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
C# Classes and Methods
BimlScript and LINQ not enough?
Need to reuse C# code?
Create your own classes and methods!
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
C# Classes and Methods
public static class Utilities {
public static string GetName(AstTableNode table) {
return table.Schema.Name.ToUpper()
+ "_" + table.Name.ToUpper();
}
}
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
C# Classes and Methods: Class
public static class Utilities {
public static string GetName(AstTableNode table) {
return table.Schema.Name.ToUpper()
+ "_" + table.Name.ToUpper();
}
}
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
C# Classes and Methods: Method
public static class Utilities {
public static string GetName(AstTableNode table) {
return table.Schema.Name.ToUpper()
+ "_" + table.Name.ToUpper();
}
}
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
C# Classes and Methods: Logic
public static class Utilities {
public static string GetName(AstTableNode table) {
return table.Schema.Name.ToUpper()
+ "_" + table.Name.ToUpper();
}
}
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Where do you put your C# code?
Code Blocks
<#+ ... #>
Code Files
<#@ code file="Utilities.cs" #>
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Code Blocks vs. Code Files
Code Blocks
• Used when logic is specific to one file
• Reuse by including files with code blocks
Code Files
• Use code editor of choice
• Create extension methods
Extension Methods
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Extension Methods
"Make it look like the method belongs to
an object instead of a helper class"
DEMO
C# Classes
and Methods
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
…the past 60 minutes…
Practical Biml Coding C# Classes and Methods
Code Management
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Feedback
How can speakers and
SQLBits improve?
Community
Where can you get
involved and learn more?
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
Get things done
Start small
Start simple
Start with ugly code
Keep going
Expand
Improve
Deliver often
Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net
@cathrinew
cathrinew.net
hi@cathrinew.net
Biml resources and references:
cathrinew.net/biml
1 of 118

Recommended

Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago) by
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)Cathrine Wilhelmsen
2K views98 slides
Biml for Beginners: Script and Automate SSIS development (Capital Area SQL Se... by
Biml for Beginners: Script and Automate SSIS development (Capital Area SQL Se...Biml for Beginners: Script and Automate SSIS development (Capital Area SQL Se...
Biml for Beginners: Script and Automate SSIS development (Capital Area SQL Se...Cathrine Wilhelmsen
2.5K views98 slides
Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton ) by
Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton )Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton )
Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton )Cathrine Wilhelmsen
834 views94 slides
Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville) by
Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville)Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville)Cathrine Wilhelmsen
978 views97 slides
Biml for Beginners: Script and Automate SSIS development (Malibu SQL Server U... by
Biml for Beginners: Script and Automate SSIS development (Malibu SQL Server U...Biml for Beginners: Script and Automate SSIS development (Malibu SQL Server U...
Biml for Beginners: Script and Automate SSIS development (Malibu SQL Server U...Cathrine Wilhelmsen
1.1K views98 slides
Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn) by
Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn)Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn)Cathrine Wilhelmsen
1.2K views99 slides

More Related Content

What's hot

Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver) by
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)Cathrine Wilhelmsen
3.7K views133 slides
Biml for Beginners: Speed up your SSIS development (SQLBits XV) by
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Cathrine Wilhelmsen
1.5K views57 slides
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota) by
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Cathrine Wilhelmsen
1.8K views119 slides
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame... by
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Cathrine Wilhelmsen
7.1K views113 slides
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o... by
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...Cathrine Wilhelmsen
3.6K views55 slides
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex... by
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Cathrine Wilhelmsen
5.9K views63 slides

What's hot(19)

Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)
Cathrine Wilhelmsen3.7K views
Biml for Beginners: Speed up your SSIS development (SQLBits XV) by Cathrine Wilhelmsen
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Cathrine Wilhelmsen1.5K views
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Cathrine Wilhelmsen1.8K views
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame... by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Cathrine Wilhelmsen7.1K views
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o... by Cathrine Wilhelmsen
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...
Cathrine Wilhelmsen3.6K views
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex... by Cathrine Wilhelmsen
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Cathrine Wilhelmsen5.9K views
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ... by Cathrine Wilhelmsen
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2... by Cathrine Wilhelmsen
Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2...Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2...
Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2...
Cathrine Wilhelmsen3.7K views
Biml Academy 2 - Lesson 5: Importing source metadata into Biml by Cathrine Wilhelmsen
Biml Academy 2 - Lesson 5: Importing source metadata into BimlBiml Academy 2 - Lesson 5: Importing source metadata into Biml
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
Cathrine Wilhelmsen8.6K views
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Cathrine Wilhelmsen1.5K views
Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat... by Cathrine Wilhelmsen
Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat...Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat...
Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat...
Cathrine Wilhelmsen3.4K views
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo)
Cathrine Wilhelmsen1.6K views
Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016)Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016)
Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016)
Cathrine Wilhelmsen1.9K views
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat... by Cathrine Wilhelmsen
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Cathrine Wilhelmsen1.4K views
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur... by Cathrine Wilhelmsen
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
Cathrine Wilhelmsen6.4K views
BIML: BI to the next level by Davide Mauri
BIML: BI to the next levelBIML: BI to the next level
BIML: BI to the next level
Davide Mauri2.2K views
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia) by Cathrine Wilhelmsen
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Cathrine Wilhelmsen1.7K views
Back from the Dead: When Bad Code Kills a Good Server by Teamstudio
Back from the Dead: When Bad Code Kills a Good ServerBack from the Dead: When Bad Code Kills a Good Server
Back from the Dead: When Bad Code Kills a Good Server
Teamstudio1.4K views

Similar to Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)

Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018) by
Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)
Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)Cathrine Wilhelmsen
19.5K views114 slides
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo) by
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)Cathrine Wilhelmsen
893 views75 slides
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S... by
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...Cathrine Wilhelmsen
1.1K views63 slides
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago) by
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)Cathrine Wilhelmsen
2.7K views82 slides
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna) by
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)Cathrine Wilhelmsen
2.8K views92 slides
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018) by
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)Cathrine Wilhelmsen
1.8K views98 slides

Similar to Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)(19)

Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)
Level Up Your Biml: Best Practices and Coding Techniques (PASS Summit 2018)
Cathrine Wilhelmsen19.5K views
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo) by Cathrine Wilhelmsen
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Oslo)
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S... by Cathrine Wilhelmsen
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...
Biml for Beginners: Script and Automate SSIS development (24 Hours of PASS: S...
Cathrine Wilhelmsen1.1K views
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago) by Cathrine Wilhelmsen
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)
Cathrine Wilhelmsen2.7K views
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna) by Cathrine Wilhelmsen
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)
Cathrine Wilhelmsen2.8K views
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018) by Cathrine Wilhelmsen
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLGrillen 2018)
Cathrine Wilhelmsen1.8K views
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLBits 2019) by Cathrine Wilhelmsen
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLBits 2019)Biml Tips and Tricks: Not Just for SSIS Packages! (SQLBits 2019)
Biml Tips and Tricks: Not Just for SSIS Packages! (SQLBits 2019)
Cathrine Wilhelmsen17.6K views
Biml for Beginners: Script and Automate SSIS development (Hybrid VC) by Cathrine Wilhelmsen
Biml for Beginners: Script and Automate SSIS development (Hybrid VC)Biml for Beginners: Script and Automate SSIS development (Hybrid VC)
Biml for Beginners: Script and Automate SSIS development (Hybrid VC)
Cathrine Wilhelmsen20.8K views
Level Up Your Biml: Best Practices and Coding Techniques (SQLDay 2018) by Cathrine Wilhelmsen
Level Up Your Biml: Best Practices and Coding Techniques (SQLDay 2018)Level Up Your Biml: Best Practices and Coding Techniques (SQLDay 2018)
Level Up Your Biml: Best Practices and Coding Techniques (SQLDay 2018)
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go... by Cathrine Wilhelmsen
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Cathrine Wilhelmsen2.2K views
Conquering Code with hjc by hjc
Conquering Code with hjcConquering Code with hjc
Conquering Code with hjc
hjc 965 views
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland) by Cathrine Wilhelmsen
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Cathrine Wilhelmsen5.4K views
How to implement a truly modular ecommerce platform on the example of Spryker... by Fabian Wesner
How to implement a truly modular ecommerce platform on the example of Spryker...How to implement a truly modular ecommerce platform on the example of Spryker...
How to implement a truly modular ecommerce platform on the example of Spryker...
Fabian Wesner2.5K views
B2C-Commerce-Developer Dumps by addisonkalven
B2C-Commerce-Developer DumpsB2C-Commerce-Developer Dumps
B2C-Commerce-Developer Dumps
addisonkalven753 views
CI/CD Templates: Continuous Delivery of ML-Enabled Data Pipelines on Databricks by Databricks
CI/CD Templates: Continuous Delivery of ML-Enabled Data Pipelines on DatabricksCI/CD Templates: Continuous Delivery of ML-Enabled Data Pipelines on Databricks
CI/CD Templates: Continuous Delivery of ML-Enabled Data Pipelines on Databricks
Databricks449 views
360suite datasheet for SAP BusinessObjects by Sebastien Goiffon
360suite datasheet for SAP BusinessObjects360suite datasheet for SAP BusinessObjects
360suite datasheet for SAP BusinessObjects
Sebastien Goiffon201 views

More from Cathrine Wilhelmsen

Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac... by
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Cathrine Wilhelmsen
337 views43 slides
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D... by
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Cathrine Wilhelmsen
47 views53 slides
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S... by
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Cathrine Wilhelmsen
94 views51 slides
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ... by
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ..."I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...Cathrine Wilhelmsen
97 views62 slides
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S... by
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Cathrine Wilhelmsen
687 views49 slides
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022) by
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)Cathrine Wilhelmsen
119 views30 slides

More from Cathrine Wilhelmsen(20)

Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac... by Cathrine Wilhelmsen
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D... by Cathrine Wilhelmsen
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S... by Cathrine Wilhelmsen
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ... by Cathrine Wilhelmsen
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ..."I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S... by Cathrine Wilhelmsen
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022) by Cathrine Wilhelmsen
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu... by Cathrine Wilhelmsen
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Cathrine Wilhelmsen3.8K views
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A... by Cathrine Wilhelmsen
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A... by Cathrine Wilhelmsen
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Understanding Azure Data Factory: The What, When, and Why (NIC 2020) by Cathrine Wilhelmsen
Understanding Azure Data Factory: The What, When, and Why (NIC 2020)Understanding Azure Data Factory: The What, When, and Why (NIC 2020)
Understanding Azure Data Factory: The What, When, and Why (NIC 2020)
Cathrine Wilhelmsen1.8K views
Azure Data Factory for the SSIS Developer (SentryOne Webinar) by Cathrine Wilhelmsen
Azure Data Factory for the SSIS Developer (SentryOne Webinar)Azure Data Factory for the SSIS Developer (SentryOne Webinar)
Azure Data Factory for the SSIS Developer (SentryOne Webinar)
Cathrine Wilhelmsen1.1K views
Azure Synapse Analytics Teaser (Microsoft TechX Oslo 2019) by Cathrine Wilhelmsen
Azure Synapse Analytics Teaser (Microsoft TechX Oslo 2019)Azure Synapse Analytics Teaser (Microsoft TechX Oslo 2019)
Azure Synapse Analytics Teaser (Microsoft TechX Oslo 2019)
Cathrine Wilhelmsen1.1K views
Lessons Learned: Understanding Azure Data Factory Pricing (Microsoft Ignite 2... by Cathrine Wilhelmsen
Lessons Learned: Understanding Azure Data Factory Pricing (Microsoft Ignite 2...Lessons Learned: Understanding Azure Data Factory Pricing (Microsoft Ignite 2...
Lessons Learned: Understanding Azure Data Factory Pricing (Microsoft Ignite 2...
Cathrine Wilhelmsen15.8K views
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019) by Cathrine Wilhelmsen
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)
Cathrine Wilhelmsen4.1K views
Creating Visual Transformations in Azure Data Factory (dataMinds Connect) by Cathrine Wilhelmsen
Creating Visual Transformations in Azure Data Factory (dataMinds Connect)Creating Visual Transformations in Azure Data Factory (dataMinds Connect)
Creating Visual Transformations in Azure Data Factory (dataMinds Connect)
Cathrine Wilhelmsen1.2K views
Building Dynamic Pipelines in Azure Data Factory (Data Saturday Holland) by Cathrine Wilhelmsen
Building Dynamic Pipelines in Azure Data Factory (Data Saturday Holland)Building Dynamic Pipelines in Azure Data Factory (Data Saturday Holland)
Building Dynamic Pipelines in Azure Data Factory (Data Saturday Holland)
Pipelines and Packages: Introduction to Azure Data Factory (Techorama NL 2019) by Cathrine Wilhelmsen
Pipelines and Packages: Introduction to Azure Data Factory (Techorama NL 2019)Pipelines and Packages: Introduction to Azure Data Factory (Techorama NL 2019)
Pipelines and Packages: Introduction to Azure Data Factory (Techorama NL 2019)
Cathrine Wilhelmsen1.4K views
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019) by Cathrine Wilhelmsen
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
Cathrine Wilhelmsen4.1K views
Building Dynamic Pipelines in Azure Data Factory (SQLSaturday Oslo) by Cathrine Wilhelmsen
Building Dynamic Pipelines in Azure Data Factory (SQLSaturday Oslo)Building Dynamic Pipelines in Azure Data Factory (SQLSaturday Oslo)
Building Dynamic Pipelines in Azure Data Factory (SQLSaturday Oslo)
Cathrine Wilhelmsen2.7K views
Uhms and Bunny Hands: Tips for Improving Your Presentation Skills (DataGrille... by Cathrine Wilhelmsen
Uhms and Bunny Hands: Tips for Improving Your Presentation Skills (DataGrille...Uhms and Bunny Hands: Tips for Improving Your Presentation Skills (DataGrille...
Uhms and Bunny Hands: Tips for Improving Your Presentation Skills (DataGrille...
Cathrine Wilhelmsen1.7K views

Recently uploaded

GDG Community Day 2023 - Interpretable ML in production by
GDG Community Day 2023 - Interpretable ML in productionGDG Community Day 2023 - Interpretable ML in production
GDG Community Day 2023 - Interpretable ML in productionSARADINDU SENGUPTA
7 views19 slides
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS Triange by
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS TriangeAnalytics Center of Excellence | Data CoE |Analytics CoE| WNS Triange
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS TriangeRNayak3
5 views6 slides
DGIQ East 2023 AI Ethics SIG by
DGIQ East 2023 AI Ethics SIGDGIQ East 2023 AI Ethics SIG
DGIQ East 2023 AI Ethics SIGKaren Lopez
6 views7 slides
DGST Methodology Presentation.pdf by
DGST Methodology Presentation.pdfDGST Methodology Presentation.pdf
DGST Methodology Presentation.pdfmaddierlegum
8 views9 slides
Lack of communication among family.pptx by
Lack of communication among family.pptxLack of communication among family.pptx
Lack of communication among family.pptxahmed164023
17 views10 slides
AZConf 2023 - Considerations for LLMOps: Running LLMs in production by
AZConf 2023 - Considerations for LLMOps: Running LLMs in productionAZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in productionSARADINDU SENGUPTA
12 views16 slides

Recently uploaded(20)

GDG Community Day 2023 - Interpretable ML in production by SARADINDU SENGUPTA
GDG Community Day 2023 - Interpretable ML in productionGDG Community Day 2023 - Interpretable ML in production
GDG Community Day 2023 - Interpretable ML in production
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS Triange by RNayak3
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS TriangeAnalytics Center of Excellence | Data CoE |Analytics CoE| WNS Triange
Analytics Center of Excellence | Data CoE |Analytics CoE| WNS Triange
RNayak35 views
DGIQ East 2023 AI Ethics SIG by Karen Lopez
DGIQ East 2023 AI Ethics SIGDGIQ East 2023 AI Ethics SIG
DGIQ East 2023 AI Ethics SIG
Karen Lopez6 views
DGST Methodology Presentation.pdf by maddierlegum
DGST Methodology Presentation.pdfDGST Methodology Presentation.pdf
DGST Methodology Presentation.pdf
maddierlegum8 views
Lack of communication among family.pptx by ahmed164023
Lack of communication among family.pptxLack of communication among family.pptx
Lack of communication among family.pptx
ahmed16402317 views
AZConf 2023 - Considerations for LLMOps: Running LLMs in production by SARADINDU SENGUPTA
AZConf 2023 - Considerations for LLMOps: Running LLMs in productionAZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in production
Listed Instruments Survey 2022.pptx by secretariat4
Listed Instruments Survey  2022.pptxListed Instruments Survey  2022.pptx
Listed Instruments Survey 2022.pptx
secretariat4148 views
Customer Data Cleansing Project.pptx by Nat O
Customer Data Cleansing Project.pptxCustomer Data Cleansing Project.pptx
Customer Data Cleansing Project.pptx
Nat O7 views
[DSC Europe 23] Branka Panic - Peace in the age of artificial intelligence.pptx by DataScienceConferenc1
[DSC Europe 23] Branka Panic - Peace in the age of artificial intelligence.pptx[DSC Europe 23] Branka Panic - Peace in the age of artificial intelligence.pptx
[DSC Europe 23] Branka Panic - Peace in the age of artificial intelligence.pptx
[DSC Europe 23] Ilija Duni - How Foursquare Builds Meaningful Bridges Between... by DataScienceConferenc1
[DSC Europe 23] Ilija Duni - How Foursquare Builds Meaningful Bridges Between...[DSC Europe 23] Ilija Duni - How Foursquare Builds Meaningful Bridges Between...
[DSC Europe 23] Ilija Duni - How Foursquare Builds Meaningful Bridges Between...
Games, Queries, and Argumentation Frameworks: Time for a Family Reunion by Bertram Ludäscher
Games, Queries, and Argumentation Frameworks: Time for a Family ReunionGames, Queries, and Argumentation Frameworks: Time for a Family Reunion
Games, Queries, and Argumentation Frameworks: Time for a Family Reunion
[DSC Europe 23] Irena Cerovic - AI in International Development.pdf by DataScienceConferenc1
[DSC Europe 23] Irena Cerovic - AI in International Development.pdf[DSC Europe 23] Irena Cerovic - AI in International Development.pdf
[DSC Europe 23] Irena Cerovic - AI in International Development.pdf
Business administration Project File.pdf by KiranPrajapati91
Business administration Project File.pdfBusiness administration Project File.pdf
Business administration Project File.pdf
KiranPrajapati9111 views
Enhancing Financial Sentiment Analysis via Retrieval Augmented Large Language... by patiladiti752
Enhancing Financial Sentiment Analysis via Retrieval Augmented Large Language...Enhancing Financial Sentiment Analysis via Retrieval Augmented Large Language...
Enhancing Financial Sentiment Analysis via Retrieval Augmented Large Language...
patiladiti7529 views

Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)

  • 1. Level Up Your Biml: Best Practices and Coding Techniques Cathrine Wilhelmsen · SQLBits · Feb 24th 2018
  • 2. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Session Description Is your Biml solution starting to remind you of a bowl of tangled spaghetti code? Good! That means you are solving real problems while saving a lot of time. The next step is to make sure that your solution does not grow too complex and confusing – you do not want to waste all that saved time on future maintenance! Attend this session for an overview of Biml best practices and coding techniques. Learn how to centralize and reuse code with Include files and the CallBimlScript method. Make your code easier to read and write by utilizing LINQ (Language-Integrated Queries). Share code between files by using Annotations and ObjectTags. And finally, if standard Biml is not enough to solve your problems, you can create your own C# helper classes and extension methods to implement custom logic. Start improving your code today and level up your Biml in no time!
  • 3. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Cathrine Wilhelmsen @cathrinew cathrinew.net Data Warehouse & Business Intelligence Consultant
  • 4. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net You… …? Know basic Biml and BimlScript Created a staging environment using Biml Created a metadata-driven Biml framework
  • 5. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net …the next 60 minutes… Practical Biml Coding C# Classes and Methods Code Management
  • 7. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Biml vs. BimlScript XML Language "Just plain text" Generate, control and manipulate Biml with C#
  • 8. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Biml Biml is an XML language – it's just plain text Easy to read and write – but can be verbose You probably don't want to write 50000 lines of Biml code manually...?
  • 9. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Generating Biml You can use any tool to generate Biml for you: • Text editor macros • Excel • PowerShell • T-SQL …but the recommended tool is BimlScript :)
  • 10. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Extend Biml with C# or VB code blocks Import database structure and metadata Loop over tables and columns Expressions replace static values Allows you to generate, control and manipulate Biml code What is BimlScript?
  • 11. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net BimlScript Code Blocks <# … #> Control Block (Control logic) <#= … #> Text Block (Returns string) <#@ … #> Directive (Compiler instructions) <#+ … #> Class Block (Create C# classes) <#* … *#> Comment Block (Comments)
  • 12. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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>
  • 13. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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>
  • 14. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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>
  • 15. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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>
  • 16. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net How does it work?
  • 17. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Yes, but how does it work?
  • 18. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Yes, but how does it actually work? <# foreach (var table in metadata.TableNodes) { #> <Package Name="Load_<#=table.Name#>"></Package> <# } #> <Package Name="Load_Customer"></Package> <Package Name="Load_Product"></Package> <Package Name="Load_Sales"></Package>
  • 20. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net What do you need?
  • 21. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net BimlExpress Free add-in for Visual Studio Code editor with syntax highlighting and Biml Intellisense Preview expanded / compiled Biml http://varigence.com/bimlexpress
  • 22. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net BimlOnline Free browser-based Biml editor Code editor with Biml and C# Intellisense Reverse-engineer from SSIS to Biml http://bimlonline.com
  • 23. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net BimlStudio Licensed full-featured development environment for Biml Visual designer and metadata modeling Full-stack automation and transformers http://varigence.com/bimlstudio
  • 24. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Biml Tools Comparison Licensed IDE replaces VS Full Automation Free Biml intellisense Preview Pane Free Full intellisense Package Import
  • 26. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Don't Repeat Yourself Centralize and reuse code Update code once in one file 1. Tiered Biml Files 2. Include Files 3. CallBimlScript
  • 28. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 29. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files Split Biml code in multiple files to: • Solve logical dependencies • Build solutions in multiple steps Specify tier per file by using the template directive: <#@ template tier="2" #>
  • 30. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files Biml is compiled 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 call RootNode to use objects from lower tiers
  • 31. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Databases Schemas Tables Packages
  • 32. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Databases Schemas Tables Packages
  • 33. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  • 34. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  • 35. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Load Packages Master Package Connections Admin Source Destination Databases Schemas Tables Packages
  • 36. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 37. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 38. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 39. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 40. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 41. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Tiered Biml Files: Behind the Scenes Connections Admin Source Destination Databases Schemas Tables Packages Load_Customer Load_Product Load_Sales Master
  • 42. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 44. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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
  • 45. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Include Files
  • 46. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Include Files
  • 47. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Include Files
  • 49. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Global Include Files Use the global directive <#@ global #> Use instead of adding include directive to all files to • Create global variables • Include code files • Make VB default language
  • 50. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Global Include Files Specify directive attributes to control global include files <#@ global order="1" location="top" active="true" applytocallbimlscript="false" #>
  • 51. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Global Include Files
  • 52. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Global Include Files
  • 53. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net How do you use Global Include Files? 1. Create Global Include File 2. Select Biml files and Global Include File 3. Right-click and click Generate SSIS Packages 1 2 3
  • 55. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net 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("Callee.biml", Parameter)#>
  • 56. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScript
  • 57. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScript
  • 58. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScript
  • 59. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScript
  • 60. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScript
  • 62. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput: Callee Callee specifies parameters and custom output: <#@ property name="Parameter" type="String" #> <# CustomOutput.BimlComment = "Comment"; #>
  • 63. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput: Caller Caller creates, passes and uses custom output: <# dynamic outObj; #> <#=CallBimlScriptWithOutput("Callee.biml", out outObj)#> <#=outObj.BimlComment#>
  • 64. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput
  • 65. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput
  • 66. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput
  • 67. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput
  • 68. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net CallBimlScriptWithOutput use CustomOutput
  • 72. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Annotations and ObjectTags Annotations and ObjectTags are Key / Value pairs Used to store and pass metadata between Biml files Annotations: String / String ObjectTags: String / Object
  • 73. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Annotations Create annotations: <OleDbConnection Name="Dest" ConnectionString="…"> <Annotations> <Annotation Tag="Schema">stg</Annotation> </Annotations> </OleDbConnection> Use annotations: RootNode.OleDbConnections["Dest"].GetTag("Schema");
  • 74. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net ObjectTags Create ObjectTags: RootNode.ObjectTag["Filter"] = new List<string>{"Product","ProductCategory"}; Use ObjectTags: var FilterList = (List<string>)RootNode.ObjectTag["Filter"];
  • 75. LINQ
  • 76. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ (Language-Integrated Query) One language to query: SQL Server Databases Datasets Collections Two ways to write queries: SQL-ish Syntax Extension Methods
  • 77. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ Extension Methods Sort OrderBy, ThenBy Filter Where, OfType Group GroupBy Aggregate Count, Sum Check Collections All, Any, Contains Get Elements First, Last, ElementAt Project Collections Select, SelectMany
  • 78. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ Extension Methods Example var numConnections = RootNode.Connections.Count() foreach (var table in RootNode.Tables.Where(…)) if (RootNode.Packages.Any(…))
  • 79. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ Extension Methods Example foreach (var table in RootNode.Tables.Where(…)) if (RootNode.Packages.Any(…)) But what do you put in here?
  • 80. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions "A lambda expression is an anonymous function that you can use to create delegates or expression tree types"
  • 81. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions …huh? o_O
  • 82. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions table => table.Name == "Product"
  • 83. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions table => table.Name == "Product" The arrow is the lambda operator
  • 84. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions table => table.Name == "Product" Input parameter is on the left side
  • 85. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions table => table.Name == "Product" Expression is on the right side
  • 86. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Lambda Expressions table => table.Name == "Product" For each object in collection, evaluate expression
  • 87. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ and Lambda Chain LINQ Methods and use Lambda Expressions for simple and powerful querying of collections: .Where(table => table.Schema.Name == "Production") .OrderBy(table => table.Name)
  • 88. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Filter collections Where() Returns the filtered collection with all elements that meet the criteria RootNode.Tables.Where(t => t.Schema.Name == "Production") OfType() Returns the filtered collection with all elements of the specified type RootNode.Connections.OfType<AstExcelOleDbConnectionNode>()
  • 89. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Sort collections OrderBy() Returns the collection sorted by key… RootNode.Tables.OrderBy(t => t.Name) ThenBy() …then sorted by secondary key RootNode.Tables.OrderBy(t => t.Schema.Name) .ThenBy(t => t.Name)
  • 90. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Sort collections OrderByDescending() Returns the collection sorted by key… RootNode.Tables.OrderByDescending(t => t.Name) ThenByDescending() …then sorted by secondary key RootNode.Tables.OrderBy(t => t.Schema.Name) .ThenByDescending(t => t.Name)
  • 91. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Sort collections Reverse() Returns the collection sorted in reverse order RootNode.Tables.Reverse()
  • 92. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Group collections GroupBy() Returns a collection of key-value pairs where each value is a new collection RootNode.Tables.GroupBy(t => t.Schema.Name)
  • 93. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Aggregate collections Count() Returns the number of elements in the collection RootNode.Tables.Count() RootNode.Tables.Count(t => t.Schema.Name == "Production")
  • 94. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Aggregate collections Sum() Returns the sum of the (numeric) values in the collection RootNode.Tables.Sum(t => t.Columns.Count) Average() Returns the average value of the (numeric) values in the collection RootNode.Tables.Average(t => t.Columns.Count)
  • 95. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Aggregate collections Min() Returns the minimum value of the (numeric) values in the collection RootNode.Tables.Min(t => t.Columns.Count) Max() Returns the maximum value of the (numeric) values in the collection RootNode.Tables.Max(t => t.Columns.Count)
  • 96. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Check collections All() Returns true if all elements in the collection meet the criteria RootNode.Databases.All(d => d.Name.StartsWith("A")) Any() Returns true if any element in the collection meets the criteria RootNode.Databases.Any(d => d.Name.Contains("DW"))
  • 97. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Check collections Contains() Returns true if collection contains element RootNode.Databases.Contains(AdventureWorks2014)
  • 98. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Get elements First() Returns the first element in the collection (that meets the criteria) RootNode.Tables.First() RootNode.Tables.First(t => t.Schema.Name == "Production") FirstOrDefault() Returns the first element in the collection or default value (that meets the criteria) RootNode.Tables.FirstOrDefault() RootNode.Tables.FirstOrDefault(t => t.Schema.Name == "Production")
  • 99. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Get elements Last() Returns the last element in the collection (that meets the criteria) RootNode.Tables.Last() RootNode.Tables.Last(t => t.Schema.Name == "Production") LastOrDefault() Returns the last element in the collection or default value (that meets the criteria) RootNode.Tables.LastOrDefault() RootNode.Tables.LastOrDefault(t => t.Schema.Name == "Production")
  • 100. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Get elements ElementAt() Returns the element in the collection at the specified index RootNode.Tables.ElementAt(42) ElementAtOrDefault() Returns the element in the collection or default value at the specified index RootNode.Tables.ElementAtOrDefault(42)
  • 101. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Project collections Select() Creates a new collection from one collection A list of table names: RootNode.Tables.Select(t => t.Name) A list of table and schema names: RootNode.Tables.Select(t => new {t.Name, t.Schema.Name})
  • 102. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net LINQ: Project collections SelectMany() Creates a new collection from many collections and merges the collections A list of all columns from all tables: RootNode.Tables.SelectMany(t => t.Columns)
  • 105. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net C# Classes and Methods BimlScript and LINQ not enough? Need to reuse C# code? Create your own classes and methods!
  • 106. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net C# Classes and Methods public static class Utilities { public static string GetName(AstTableNode table) { return table.Schema.Name.ToUpper() + "_" + table.Name.ToUpper(); } }
  • 107. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net C# Classes and Methods: Class public static class Utilities { public static string GetName(AstTableNode table) { return table.Schema.Name.ToUpper() + "_" + table.Name.ToUpper(); } }
  • 108. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net C# Classes and Methods: Method public static class Utilities { public static string GetName(AstTableNode table) { return table.Schema.Name.ToUpper() + "_" + table.Name.ToUpper(); } }
  • 109. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net C# Classes and Methods: Logic public static class Utilities { public static string GetName(AstTableNode table) { return table.Schema.Name.ToUpper() + "_" + table.Name.ToUpper(); } }
  • 110. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Where do you put your C# code? Code Blocks <#+ ... #> Code Files <#@ code file="Utilities.cs" #>
  • 111. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Code Blocks vs. Code Files Code Blocks • Used when logic is specific to one file • Reuse by including files with code blocks Code Files • Use code editor of choice • Create extension methods
  • 113. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Extension Methods "Make it look like the method belongs to an object instead of a helper class"
  • 115. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net …the past 60 minutes… Practical Biml Coding C# Classes and Methods Code Management
  • 116. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Feedback How can speakers and SQLBits improve? Community Where can you get involved and learn more?
  • 117. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net Get things done Start small Start simple Start with ugly code Keep going Expand Improve Deliver often
  • 118. Cathrine Wilhelmsen - contact@cathrinewilhelmsen.net @cathrinew cathrinew.net hi@cathrinew.net Biml resources and references: cathrinew.net/biml