Notes from a TSQL trench

Database stuff,
with a side of memes.

Long-form notes on TSQL performance, Extended Events, Query Store and the tooling around them. Written from the trenches, not the slide deck.

62 posts 4 series 109+ memes
What is causing my constraint to be untrusted?

What is causing my constraint to be untrusted?

You fix an untrusted constraint, and by morning it's back to untrusted. Here's how to catch the process responsible, using Extended Events.

Investigation 7 min read Extended Events · Debugging
How Scalar Functions Prevent Parallelism

How Scalar Functions Prevent Parallelism

Consultants hate me for this one weird trick. Because I'll be uncovering all the mess Scalar functions can cause in a series of articles.

Deep Dive 6 min read Performance · SQL Server 2022
Coding Standards (T-SQL Tuesday #151)

Coding Standards (T-SQL Tuesday #151)

My T-SQL Tuesday #151 entry: the SQL habits I swear by, and the ones I'd ban from every codebase if I could.

T-SQL Tuesday 4 min read Productivity
New Extended Events in SQL Server 2022

New Extended Events in SQL Server 2022

SQL Server 2022's CTP has dropped. I diffed its Extended Events against 2019 and pulled out the few new ones worth a look.

Deep Dive 2 min read SQL Server 2022 · Extended Events
Efficient Cheating at Lego Video Games

Efficient Cheating at Lego Video Games

My daughter's LEGO game makes you re-enter every cheat on a clunky six-dial lock. So I built a TSQL solver to find the shortest path through all of them.

How to 8 min read Regex
Why my way of writing SQL is superior

Why my way of writing SQL is superior

Semicolons, leading commas, single-letter aliases. Here is the SQL style everyone loves to argue about, and the practical reasons I refuse to budge.

Opinion 5 min read Productivity