---
title: "How to identify and resolve blocking queries in SQL Server?"  
description: "How to identify and resolve blocking queries in SQL Server?"  
author: "Rana Sunny"  
published: 2026-09-19  
canonical: https://answers.mindstick.com/qa/117237/how-to-identify-and-resolve-blocking-queries-in-sql-server  
category: "SQL Server"  
tags: ["sql-server", "database", "troubleshooting", "performance-tuning", "tsql"]  
reading_time: 1 minute  

---

# How to identify and resolve blocking queries in SQL Server?

During peak load, our database server experiences severe performance degradation due to query blocking. Transactions stall, causing API timeouts across our microservices. What scripts can I run to identify the lead blocker and resolve lock contention quickly?

## Finding Active Blockers

You can query dynamic management views (DMVs) to isolate blocking sessions immediately.

```sql
-- Select blocked and blocking session details
SELECT
    r.session_id AS blocked_session_id,
    r.blocking_session_id,
    r.wait_type,
    r.wait_time,
    t.text AS sql_text
FROM sys.dm_exec_requests r
-- Cross apply to retrieve the exact T-SQL query text
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
WHERE r.blocking_session_id <> 0;
```

### Resolution Strategies

- Add missing indexes to shorten transaction lock duration
- Use read committed snapshot isolation (RCSI) to eliminate reader-writer blocking
- Keep transactions short and avoid user interaction within explicit transactions


---

Original Source: https://answers.mindstick.com/qa/117237/how-to-identify-and-resolve-blocking-queries-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
