Blog

Longer writing that pulls the reference material together into one narrative, with the specifics linked back to the docs.

October 18, 2026

Why T-SQL's MERGE has a bad reputation

MERGE reads as one atomic insert-or-update statement. Under concurrent load it isn't one — and the two specific ways it breaks are well documented, well known, and still catch people who've used MERGE for years.

t-sqldmltroubleshooting

October 18, 2026

Parameter sniffing: when SQL Server's cached plan is wrong for you

A stored procedure that's fast for everyone else and slow for you isn't broken — it compiled a plan for someone else's data distribution, and SQL Server is reusing it instead of rethinking it.

t-sqlperformancetroubleshooting

October 18, 2026

Scalar UDFs in T-SQL: why they're slower than they look

A scalar function reads like it's just reusable logic. Historically, calling one inside a SELECT forced SQL Server to abandon set-based execution entirely and run your query one row at a time — and that's a bigger deal than it sounds.

t-sqlperformance

October 6, 2026

CTE vs temp table vs table variable: which one in T-SQL

Three ways to name an intermediate result in T-SQL, and they are not interchangeable — one gets real statistics, one doesn't, and one disappears the moment you close over it.

t-sqlperformanceguide

October 6, 2026

ISNULL vs COALESCE: the truncation bug T-SQL lets you write

Both fill in a value when something is NULL. They pick the output's data type by completely different rules, and the difference silently truncates real data in exactly the cases where it matters most.

t-sqltype-coerciontroubleshooting

October 6, 2026

Reading a SQL Server execution plan: the Key Lookup problem

The graphical plan in SSMS has its own vocabulary — operators, arrow thickness, cost percentages — and one specific icon pattern that's worth learning to spot on sight.

t-sqlperformanceguide

September 11, 2026

NULL in SQL: the complete guide

NULL isn't zero or an empty string — it's "unknown," and that one idea explains a dozen behaviors that otherwise look like bugs.

nullguide

September 5, 2026

The order SQL actually runs in

You write SELECT first, but it runs almost last. The logical processing order, and the errors that stop being mysterious once you know it.

fundamentalsguide

September 5, 2026

The complete guide to SQL window functions

Everything from ROW_NUMBER to custom frames, in one narrative — with the specifics linked back to the reference.

window-functionsguide

September 5, 2026

Why your query returns the wrong number of rows

Two causes account for almost all of it — a join that multiplied rows, and a WHERE that deleted them. Both are easy to see once you know where to look.

joinstroubleshooting