Deploy at Low Priority
Deploy SQL Server schema changes without a maintenance window using a WAIT_AT_LOW_PRIORITY-inspired loop that checks for SCH-S locks and bails out with GOTO.
Long-form notes on TSQL performance, Extended Events, Query Store and the tooling around them. Written from the trenches, not the slide deck.
Deploy SQL Server schema changes without a maintenance window using a WAIT_AT_LOW_PRIORITY-inspired loop that checks for SCH-S locks and bails out with GOTO.
Why SQL Server's fn_xe_file_target_read_file is so frustrating: an nvarchar(max) return type, broken timestamp filtering, and no efficient way to find rollover files.
How I configure SQL Server Management Studio: window layout, the Options settings that matter, essential hotkeys, and small productivity wins for DBAs.
How lock partitioning causes async stats updates to block during online index rebuilds with WAIT_AT_LOW_PRIORITY - full repro and the SQL Server 2022 fix.
SQL Server stores event_file data in the error log folder when no full path is given. Steps to find the current location and change it, on Windows and in Docker.
Creating the clustered index on an Indexed View blocked unrelated queries even under RCSI. The cause was Enterprise view matching, fixable with EXPAND VIEWS.
A CHECK or FOREIGN KEY constraint keeps reverting to untrusted overnight. Here is how to catch the BULK INSERT or bcp process doing it, with Extended Events.
Scalar UDFs silently force your query to run serially, killing parallelism. Even a reference through a view, computed column, or check constraint does it.
How to set up module signing with certificates in SQL Server for cross-database access - without ownership chaining. Complete walkthrough with diagram and follow-along example.
Are semicolons required in SQL Server statements? Plus leading commas, single-letter aliases, and the other TSQL formatting choices I refuse to budge on.
DMVs and Query Store store the query hash as binary(8), but Extended Events shows a number, and the two refuse to match. Here's how to map between them.
The KEEP PLAN hint is supposed to relax recompilation thresholds, but the docs are vague. I test it against permanent and temp table statistics thresholds.
Combine an AFTER UPDATE trigger with Extended Events to surgically audit only the data changes you care about, cutting through thousands of modifications.
An IS lock appeared in a deadlock report on a database running RCSI - which shouldn't take shared locks. The culprit turned out to be an Indexed View.
Query Store defaults aren't exactly what the docs say. This post finds the real values using Extended Events and explains what Auto capture mode actually means.
Track down SQL Server errors using Extended Events. Capture the full calling stack, parse it with TSQL, and pinpoint exactly where failures happen.
A colleague needed to find who was changing a specific cell in a busy table. SQL Audit was too noisy, Query Store too vague. I found a way to combine triggers with Extended Events for surgical precision.
I found an IS lock in a deadlock report on an RCSI database. That shouldn't be possible. Here's what caused it.
Sometimes the fastest help is the kind you find yourself. A rundown of the lazy question patterns I keep seeing in SQL help channels.
This month's T-SQL Tuesday invitation is from John McCormack. I'm sharing a few handy snippets I use on a regular basis - a time loop, impersonation testing, database recreation, and some RegEx for SSMS Find & Replace.
One query against sys.messages can reveal every edge case SQL Server knows about before you commit to a new design.
Query Store comes with default settings - but are they what the documentation says? Let's find out using a simple Extended Events session.
Production errors are hard to reproduce. Here's my go-to Extended Events session that captures errors with their full TSQL calling stack.