I’m giving a free webinar for MSSQLTips.com at 11th of August 2022. The abstract: When building a data warehouse (DWH) in the Microsoft Data Platform stack, you typically have to write a fair share of T-SQL. Loading data into the data warehouse, transforming it into the desired format, troubleshooting and debugging, and writing source queries […]
Tag: t-sql
T-SQL Tuesday #149 – T-SQL Advice you’d give to your younger self
It’s the second Tuesday of the month, so it’s time for the T-SQL Tuesday blog party! This month’s topic is chosen by Camila Henrique (blog): what T-SQL advice would you give to your younger self? Here’s a little list I’d tell anyone starting out with T-SQL: you can configure most tools that when you hit […]
T-SQL Linting in an Azure Devops Build Pipeline
Linting is a process where a code analyzer is run to find programmatic errors, bugs, “stylistic constructs” or anti-patterns. For example, in Python there are specific modules that help you with linting when the code is build. If the code is not indented correctly (or whatever rule your code has to obey in Python), the […]
Convert Local Datetime to UTC (pre-SQL Server 2016)
Recently I was working with a client who was still on SQL Server 2012. Support issues aside, there are some very useful T-SQL functions/clauses who didn’t exist in 2012, but were introduced in a later version. One of them is AT TIME ZONE, which you can use the convert dates between time zones, as demonstrated […]
Speaking at SQLBits 2022
I’m delighted to announce I’ll be speaking at the SQLBits conference in March 2022! I’m not delivering one session, but two this time. Well, actually, for one session I’m co-presenting with Mala Mahadevan. I’m really looking forward to this session, as it’s a not-well known topic (I hadn’t heard about it till Mala told me […]
T-SQL Tuesday #143 – Short code examples
It’s this time of the month again! T-SQL Tuesday is a monthly blogging party on the second Tuesday. This month’s topic is “What are your go to handy short scripts?” brought to you by John McCormack. What are those little short bits of code that you can’t live without? I’m talking about little snippets that […]
Converting a Datetime to UTC
I was in a need of converting some datetime values (of which I know the actual timezone) to UTC dates. A quick Google search showed me that most results on the first page were simply wrong. Most of them used this trick: Seems nifty, but they forgot about daylight savings time. If I run the […]
Optimize for Unknown for Inline Table-Valued Functions
I had a curious performance issue today. An inline table-valued function (iTVF) was performing poorly for some parameter sets, and quite fast for other parameter values. In short, this one is fast: This one is slow: Turns out SQL Server used a plan with a hash join in the fast query, and a nested loop […]
Book Review: T-SQL Window Functions by Itzik Ben-Gan
A couple of years back Itzik Ben-Gan (the T-SQL guru) wrote the book Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions. It’s has been one of my most favorite technical books (I included it in this list): it was really an eye-opener to how useful and powerful window functions can be. It teaches the […]
SQL Server Development Best Practices – Webinar
I’m delighted to announce I’ll be giving a webinar for MSSQLTips.com about SQL Server Development Best Practices. Aka writing T-SQL and stuff 🙂 The webcast is the 13th of June 2019 at 7PM UTC. In a nutshell, I’ll be talking about the stuff I would tell my 10-year younger self about T-SQL development (if I […]