An Introduction to the magical world of BIML! Jonathan Stewart
An Introduction to… The magical world of Biml! http://www.starseeds.net/photo/magical-world
Agradecimiento a los patrocinadores Premium Silver Personal
Business Intelligence Consultant Jonathan Stewart Business Intelligence Consultant @sqllocks jonathan.stewart@sqllocks.net
Agenda History Problems solved by Biml Biml Basics Biml Script Reusability Where to learn more!
CEO of Varigence and Creator of Biml Scott Currie CEO of Varigence and Creator of Biml
What is it?
Business Intelligence Markup Language XML Based Can be used to create SSIS packages, SSAS cubes and SQL Server DDL (Databases, Tables, Columns, Views, Etc).
What problems can Biml Help you solve?
Tedium
Repetition and limited reuse
Inconsistency
The super quick xml primer
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”/></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic xml statement… <root> < parent name="Goku" age="37"> <child name="Gohan" age="17" SuperSaiynLevel=”3”></child> <child name="Goten" age="6" SuperSaiynLevel=”1”></child> </parent> </ root >
The basic Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="Package1"></Package> <Package Name="Package2"/> </Packages> </Biml>
The basic Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="Package1"></Package> <Package Name="Package2"/> </Packages> </Biml>
The basic Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="Package1"></Package> <Package Name="Package2"/> </Packages> </Biml>
The basic Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="Package1"></Package> <Package Name="Package2"/> </Packages> </Biml>
The basic Biml syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <Package Name="Package1"></Package> <Package Name="Package2"/> </Packages> </Biml>
Biml and XML similarities Reeves Smith, Andy Leonard
What do we need to get started?
How does it work?
How does it work?
Root types (AKA Elements) Connection Packages Databases Script Projects Schemas Cubes Tables Principals Dimensions Facts
Biml Script Allows you to extend Biml with C# or VB. Allows all of the configurable magic that you’ve come to expect. Begins and ends with delimiters.
The Basic BimlScript syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# for (int i = 1; i <= 5, i++) { #> <Package Name="MyPackage<#=i#>" ConstraintMode=“Linear”> </Package> <# } #> </Packages> </Biml>
The Basic BimlScript syntax <Biml xmlns="http://schemas.varigence.com/biml.xsd"> <Packages> <# for (int i = 1; i <= 5, i++) { #> <Package Name="MyPackage<#=i#>" ConstraintMode=“Linear”> </Package> <# } #> </Packages> </Biml>
Directives Two main type of directives: Template - <#@ template language=“C#” #> Import - <# import namespace=“Varigence.Languages.Biml.Connection” #> Other directives: Annotation Import Target Assembly Output Dependency Property
Delimiters <#@ #> Directives <# #> Standard Control Block <# #> Standard Control Block <#= #> Expression Control Block <#+ #> Class Feature Control Block
Standard Control blocks Defines .NET code commonly referred to as Biml Script or Code Nuggets. <# for (int i = 1; i <= 5; i++) { #>
Expression control blocks Evaluates the .NET code, converts it to a string, then embeds it in the Biml file. <#= UppercaseFirst("hello world") #>
Class feature control blocks Defines properties, methods, and files that are excluded from the Biml file but may be accessed by other BimlScript code nuggets.
?
How to reuse Biml files Tiered Biml files Include files CallBimlScript using parameters
Tiered Biml Files Uses the template directive with the following syntax: <#@ template language=”C# or VB” tier=”tier number” #> Used when requiring objects from a previous file to enforce order. Files from the same tier will compile in any order. Root Node
<#@ include file=”ImportedBimlFile.biml” #> Include Directives Include directives allow you to import other Biml files. <#@ include file=”ImportedBimlFile.biml” #>
CallBimlScript using parameters Like a stored procedure! Or Method/Function (if you are a programmer ) Callee Script to be called Caller Active script
Callee
Caller
BimlFy-ing your current SSIS packages How do you get your current SSIS packages into Biml? Biml Online!
Where to learn more… Varigence BimlScript Samples - https://varigence.com/Documentation/Samples/Biml/ Forums - https://www.varigence.com/Forums?forumName=Biml Documentation - https://www.varigence.com/Documentation/Language/Index BimlScript Intros/Tutorials - http://bimlscript.com Quick Reference - http://bimlscript.com/Develop/Resources Walkthroughs - http://www.bimlscript.com/#home/category/walkthrough Cathrine Wilhelmsen - http://www.cathrinewilhelmsen.net Stairway to BIML- http://www.sqlservercentral.com/stairway/100550/ BIML Academy - http://biml.academy
Questions
Business Intelligence Consultant Jonathan Stewart Business Intelligence Consultant @sqllocks jonathan.stewart@sqllocks.net