Skip to content

Generating SQL using Biml (T-SQL Tuesday #110)

T-SQL Tuesday #110: Generating SQL using Biml

The first T-SQL Tuesday of 2019 is hosted by Garry Bargsley (@gbargsley), and the topic is “Automate All the Things“. Garry wants to know what this phrase means to each of us. What do we want to automate? What is our go-to technology for automation? To me, this was super easy. Surprise, surprise! It’s Biml, of course :) Since this post is part of T-SQL Tuesday, I wanted to go back to the basics and write about how you can generate SQL using Biml. But first, a little bit of background for those who are not that familiar with Biml.

Continue reading →

Don’t Repeat Your Biml – C# Extension Methods

Don't Repeat Your Biml - C# Extension Methods

In a previous blog post, we looked at how to use C#/VB Code Files in Biml. There are several benefits to moving custom C# code into separate files. It allows you to reuse that code across multiple projects and solutions. You can maintain the code in your editor of choice, taking advantage of intellisense and syntax highlighting. And finally, my personal favorite: you can create custom extension methods.

In this post, we will look at how to simplify our Biml projects by creating and using C# extension methods. We will build on the examples from the previous C#/VB Code Files in Biml blog post.

Continue reading →

Speaking at SQLSaturday Oslo 2018

SQLSaturday Oslo 2018In exactly one month from now, on September 1st, I will be speaking at SQLSaturday Oslo 2018! This year is a small milestone for us, as it is our fifth SQLSaturday in Oslo. Woohoo!

SQLSaturday Oslo 2018 Schedule

I will be presenting… Actually, hang on! I will get back to that in a bit. Scroll down for some rambling about my session :) But first, the important stuff:

There are 30 sessions by 27 speakers from 11 countries scheduled this year.

Of the 27 speakers, there are 7 women, and 4 of the women are Norwegian! These are amazing numbers for an event like this. I am SO proud and SO happy :D Thank you to the organizers for encouraging and supporting women in tech, and a huge thank you to these amazing women for being great role models: Dagrun Haugland, Gabi Münster, Ida Bergum, Kathi Kellenberger, Sara Jønvik, and Steph Locke.

There are also 3 Norwegian men speaking! Very happy to see Helge Rege Gårdsvoll, Martin Keseler Barland, and Antonio Abalos Castillo back at SQLSaturday Oslo. That makes it a total of 7 Norwegian speakers this year. Woohoo!

Finally, there are 4 precons scheduled: You can learn about Azure SQL Data Warehouse from Simon Whiteley and Terry McCann, SQL Server Tools for Query Tuning from Grant Fritchey, PowerShell and SQL Server from Rob Sewell and Drew Furguiele, or R for Everyone from Steph Locke.

You definitely don’t want to miss this event. Register now! And follow @SQLSatOslo and #SQLSatOslo on Twitter to join the conversation. Hope to see you in September! :)

From SQLSaturday Oslo 2014 to SQLSaturday Oslo 2018

Ok, now that we have the important parts out of the way, let’s return to my session. Did you know that the very first technical session I ever presented was at the first SQLSaturday Oslo in 2014? I presented a session called Generate SSIS packages automatically with Biml and BimlScript. This year, I will be presenting my updated Biml for Beginners: Script and Automate SSIS Development session.

Same topic, same basic concept and ideas, some similar visualizations, but a very different session. And I mean in more ways than going from 4:3 to 16:9:

I have changed

SQLSaturday Oslo 2014 - Cathrine Wilhelmsen - Slide 1 SQLSaturday Oslo 2018 - Cathrine Wilhelmsen - Slide 1
My hair is much longer and my URL is much shorter. I’ve become a BimlHero and Data Platform MVP, and I’ve co-authored two Biml books. And it all started with this one Biml session back in 2014! Crazy :)

Continue reading →

Biml for OData Source and Connection Manager in SSIS

Biml for OData Source and Connection Manager

As of July 2018, there is no built-in Biml support for OData. To work with OData in Biml, you have to create a custom source and connection manager. This requires more Biml code than built-in functions like OleDbSource and may look a little overwhelming at first. But don’t worry! You don’t have to start from scratch.

In this blog post, we will first look at the properties of the OData Connection Manager and how to script it in Biml. Then, we will do the same for the OData Source. Finally, we will tie it all together and create a complete SSIS package that you can use a starting point for your own projects.

The Quick and Easy Solution

But before we dig into any code, let’s skip to the quick, easy, and timesaving solution. That’s what we all really want, right? :)

  1. Install or upgrade to BimlExpress 2018
  2. Create an example SSIS package using an OData Source and Connection Manager
  3. Convert the SSIS package to Biml
  4. Done! :)
Convert SSIS Packages to Biml

As promised: quick, easy, and timesaving! The new Convert SSIS Packages to Biml feature was released in BimlExpress 2018, and it really is a lifesaver. After converting to Biml, you can simply copy and paste the code into your projects.

However!

You may run into some bugs when you convert your SSIS packages to Biml. I ran into two issues while writing this blog post. The first was that I had to add UsesDispositions=”true” to the Source component. The second was that the data types in the Source component were prefixed with System. I have fixed both of these issues in my examples below. In addition to these issues, the converted Biml also contained some unnecessary code. Unnecessary code does not break anything, but it can make your code harder to read and maintain. Personally, I prefer my code to be as clean and simple as possible.

Ok, let’s dig into the actual Biml code!

Continue reading →

Speaking at SQLGrillen 2018

SQLGrillen 2018On Friday, June 22nd, I will be eating bratwurst, drinking beer, and talking about Biml at SQLGrillen 2018 in Lingen, Germany. I will leave it up to you to rank the importance of those three things. What I will say is that I’m thrilled and honored to be a part of it this year! I have watched the event grow from a small, local event to breaking all records this year. There will be three precons, five tracks, 35 sessions, 200 attendees, and lots and lots and lots of fun. The tagline is literally “SQLGrillen: Databases, Bratwurst & Beer” – how can that not be an amazing event :)

If you think this sounds fun and want to squeeze in a trip to Lingen, this is your lucky day! There are a few last-minute tickets left. Go grab one before it sells out!

SQLGrillen 2018 Schedule

I will be presenting my brand new session Biml Tips and Tricks: Not just for SSIS packages! That’s right, I won’t be generating a single SSIS package in my session. (If you want to learn how to do that, go to Ben Weissman’s session Let’s build SSIS packages with Biml – live!) In my session, I will show you how to use Biml for other things, like generating T-SQL, creating test data, populating static dimensions, and comparing tables and views across databases. I really should have called my session “Cathrine does crazy things with Biml”, haha!

If Biml is not really your thing, check out the rest of the schedule and speaker list. Wow.

Newcomer Track at SQLGrillen 2018

My favorite part of SQLGrillen 2018 is the Newcomer Track. Seven brand new speakers will get the chance to speak at a conference for the first time! Each newcomer was assigned a mentor to help them prepare for their session. I have been helping Robert French (@sql_bob) over the last few months, and I think I’m even more excited to watch him present than I am about my own session! Robert is presenting his great session Soft Skills for Success. I know it’s great because I got a sneak peek while he was rehearsing :D

See you there?
While we are waiting, join the conversation on Twitter by following @SQLGrillen and using the hashtag #SQLGrillen.

Please let me know if you are attending SQLGrillen 2018 so I can say hi! :)