Do you use C#/VB classes and methods in your Biml projects? One solution is to create class nuggets <#+ … #>, but they can only be used in their containing Biml file. You can move class nuggets to separate files and include those files, but a more elegant solution is to use C#/VB Code Files.
In addition to using C#/VB Code Files, there are four other main ways you can avoid repeating your Biml code:
Are you using Biml so you won’t have to do the same tasks over and over and over again in multiple SSIS packages? If so, you probably don’t want to write the same Biml code over and over and over again either. Instead, you can move common code to separate files, centralize and reuse these files in many projects, and update code in one file to make changes to all projects. One of the ways to apply this Don’t Repeat Yourself software engineering principle in Biml is to use Include Files.
In addition to using Include Files, there are four other main ways you can avoid repeating your Biml code:
If you are using BIDS Helper or BimlExpress to generate SSIS packages in the Project Deployment model, you have probably noticed that it is not possible to create project parameters from Biml. You can write Biml for the project and project parameters, but BIDS Helper / BimlExpress will only generate the SSIS packages for you and not the SSIS project parameters. The recommended solution is that you create the project parameters manually before you generate your SSIS packages from Biml.
However, if you are a lazy developer like me, you probably don’t want to create and update project parameters manually. Perhaps you want to automatically create or update project parameters based on some metadata? You can do that!
Let’s take a look at a (semi-hardcoded, semi-hack) solution for creating SSIS project parameters from Biml in BIDS Helper / BimlExpress :)
Last week I visited Belgium for the first time to attend and speak at my first SQL Server Days 2015. It was a truly great event, and I would like to say a huge thank you to the organizers and volunteers for making it a wonderful couple of days for speakers and attendees!
The venue was spectacular, but unfortunately none of my pictures do it justice. Take a look at the great pictures on the SQL Server Days Facebook page instead. I loved the huge open area in the middle where everyone could meet during breaks, and I was so happy there was unlimited coffee and chocolate! :) The rooms were all unique and fun to present in. One room looked like a library, another like a bar, and I presented in the room that was decorated like a train station – with trains in it!
I presented my Don’t Repeat Yourself – Agile SSIS Development with Biml and BimlScript session. It is based on my Biml introduction session, but included some of the more advanced features like C# classes / methods and Transformers in Mist. My attendees were a mix of people who were completely new to Biml, people who had tried basic Biml and people who had already created advanced Biml frameworks. It was a bit tricky to cover everything for everyone in just one hour, and I know I went too fast through a couple of demos, but I hope it wasn’t a waste of time for those of you who attended :)
The slide deck is available on SlideShare, and I have uploaded all the demo files on my Biml Resources and Reference page for you to go through at your own pace. Some instructions are included in the README.txt file, and feel free to contact me with any questions. I will continue to update the demo files with new and improved examples. You can always find the latest version on my Biml Resources and References page.
Speakers! What a great bunch of people :)
First picture: Attendees eating lunch. Second picture: The room I presented in, wow!
Thank you so much for having me, and I hope I can come back in 2016! :)
This post was first published in July 2015, and was last updated in August 2018.
One of the main tasks in Biml projects is to import source metadata. The recommended method is GetDatabaseSchema. This method returns an ImportResults object that contains SchemaNodes (schema metadata) and TableNodes (table and view metadata).
Are you using Biml so you won’t have to do the same tasks over and over and over again in multiple SSIS packages? If so, you probably don’t want to write the same Biml code over and over and over again either. Instead, you can move common code to separate files, centralize and reuse these files in many projects, and update code in one file to make changes to all projects. One of the ways to apply this Don’t Repeat Yourself software engineering principle in Biml is to use CallBimlScript.
In addition to using CallBimlScript, there are four other main ways you can avoid repeating your Biml code:
Yesterday we did another fun #SQLHangout about Biml. This time we were joined by João Lopes (@SQLSniper), Rasmus Reinholdt (@RasmusReinholdt) and Régis Baccaro (@regbac) – great guys that I admire. It was interesting to hear how we use Biml in different ways and what we would like to see happen in 2015. I look forward to seeing all of them again and learn from their experiences!
Five people from Bulgaria, Denmark, Portugal and Norway talking about Biml – isn’t that awesome? :)
When Boris (@brshristov) invited me to a #SQLHangout I was really honored and couldn’t say no. It’s such a fun idea and I’ve really enjoyed watching the other #SQLHangouts. It’s great to see people’s personalities shine through in videos instead of only reading their blog posts, and I learn something new.
I suggested to chat about Biml, something I’ve only recently begun learning myself that has already saved me many hours of work. I still have so much to learn, but the fact that it took me about 20 hours to learn something new that has saved me and my coworkers hundreds of hours already… That’s worth sharing. If I can do it, you can do it!
Boris named the video “Biml. An introduction.” I thought a more appropriate name was “Blabbering about Biml” :)
I forgot to mention their names, but thank you to Julie Smith (@JulieChix) and André Kamman (@AndreKamman) for inspiring me to learn more Biml in their SQLSaturday sessions in Tampa and Copenhagen! :)
At work we wanted to start using Biml to speed up development in our existing projects without making too many changes at once. I decided to start by writing Biml files that generates SSIS packages exactly like the ones we already have so we can implement changes faster, and step one was to figure out how to create Package Configurations and Connection Managers in Biml:
Create an XML configuration file Package Configuration
Create the Connection Manager specified in the XML configuration file
Create SQL Server Package Configurations that use the Connection Manager specified in the XML configuration file
Create Connection Managers specified in the [SSIS Configurations] table in SQL Server
The table below is a simplified mapping between SQL Server, SSIS and Biml Data Types. It does not include all possible mappings or all data types, but is meant as a quick reference while developing and learning Biml. I mainly created it as a cheat sheet for myself, but I hope other Biml developers will find it useful!