Finding nested references
Your stored procedure calls another procedure, which calls a view. How deep does it go? Here's a recursive CTE that traces the full dependency chain, including cross-database references.
Your stored procedure calls another procedure, which calls a view. How deep does it go? Here's a recursive CTE that traces the full dependency chain, including cross-database references.
I was paged for a blocking chain where the lead blocker had a transaction name I'd never seen: CSbRollbackHandlerTask::DisableQ. Here is how I reproduced it and why the blocked process report refuses to help.
An index rebuild quietly blocked an async stats update, and the whole server started timing out. Here is the lock-partitioning repro and the SQL Server 2022 fix.
Does ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY log its victims in the error log the same way KILL does? Let's find out.
Read a cautionary tale on how I've deceived the SSMS, then promptly forgot about it and, in turn, ultimately confused myself.
Here are the chronicles of my struggles to add a large Clustered index to a View without causing an outage.
My T-SQL Tuesday rant: an app that connects as '.Net SqlClient Data Provider' turns debugging into a manhunt. Please, name your apps.
You fix an untrusted constraint, and by morning it's back to untrusted. Here's how to catch the process responsible, using Extended Events.
I keep relearning how to set up secure cross-database access, so here's the reminder: a diagram plus a full follow-along example you can run yourself.
How can 15 be less than 13? A perfect storm of bad assumptions about sql_variant comparison rules.
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.
One query against sys.messages can reveal every edge case SQL Server knows about before you commit to a new design.
Production errors are hard to reproduce. Here's my go-to Extended Events session that captures errors with their full TSQL calling stack.