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.

Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

2,362 views

Published on

Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS) (Presented at 24 HOurs of PASS Growing Our Community Edititon on June 25th 2015)

Published in: Technology
  • Be the first to comment

Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

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

×