Live classes start in 1d 07h 54m — Save your seat

Blocking and Deadlock Troubleshooting

Capturing and resolving blocking chains, deadlocks, and application locks.

40 associated posts39 primary posts

T-SQL & Development

The Last Ticket/Issue I Closed #TSQL2sday

For this month's T-SQL Tuesday, I asked y'all to write about the most recent ticket or issue that you closed. (If you want to see other peoples' posts, you can check out the comments on that invite post, or wait til next week and I'll publish a wrap-up of everyone's answers.)

A past client emailed me with a performance emergency. Things had been going just fine, and then out of nowhere, things suddenly slowed down.

Read more about The Last Ticket/Issue I Closed #TSQL2sday 19 comments — Join the discussion
Performance Tuning

When You’re Troubleshooting Blocking, Look at Query #2, Too.

When I'm troubleshooting a blocking emergency, the culprit is usually the query at the head of a blocking chain. Somebody did something ill-advised like starting a transaction and then locking a whole bunch of tables.

But sometimes, the lead blocker isn't the real problem. It's query #2.

Read more about When You’re Troubleshooting Blocking, Look at Query #2, Too. 2 comments — Join the discussion

Remember “Nothing Stops a Hekaton Transaction?” Yeah, About That.

When In-Memory OLTP first came out, Microsoft liked to go around bragging at conferences that "Nothing stops a Hekaton transaction." I remember hearing that and kinda chuckling at the time, and I was reminded of it by a recent client who was running into blocking issues with...yep, Hekaton.

To reproduce it:

Read more about Remember “Nothing Stops a Hekaton Transaction?” Yeah, About That. 2 comments — Join the discussion

Writing Diagnostic Queries is Hard Because SQL Server Still Has (Tiny) Bugs.

When I first got started working with SQL Server, I assumed it was flawless because it came in a sealed box from a ginormous corporation. I figured they'd tested every edge case, and that there was no way things were gonna go sideways. These days, even though I read CU KB articles and giggle about…

Read more about Writing Diagnostic Queries is Hard Because SQL Server Still Has (Tiny) Bugs. 15 comments — Join the discussion

How to Troubleshoot Blocking and Deadlocking with Scripts and Tools

When you need to find which queries are blocking other queries, your decision comes down to when the blocking happened. Is it happening now, recently, or coming up soon? During a live emergency, start with sp_WhoIsActive. Adam Machanic's excellent free sp_WhoIsActive replaces Activity Monitor, sp_who, and sp_who2, and it's way more powerful. The documentation is extensive -…

Read more about How to Troubleshoot Blocking and Deadlocking with Scripts and Tools 2 comments — Join the discussion