<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Row Locks on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/row-locks/</link><description>Recent content in Row Locks on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Thu, 22 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/row-locks/index.xml" rel="self" type="application/rss+xml"/><item><title>Rank Index Contention with sys.dm_db_index_operational_stats</title><link>https://www.sqlserver70.com/post/rank-index-contention-with-sys-dm-db-index-operational-stats/</link><pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/rank-index-contention-with-sys-dm-db-index-operational-stats/</guid><description>
&lt;p&gt;Once &lt;code&gt;sys.dm_os_wait_stats&lt;/code&gt; points to locking, the next question is which index the waits belong to. The script below reads &lt;code&gt;sys.dm_db_index_operational_stats&lt;/code&gt; for the current database and ranks each user-table index by its number of row-lock waits. Next to each count it returns the share of row-lock requests that had to wait and the average wait in milliseconds.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-objects/sys-dm-db-index-operational-stats-transact-sql?view=sql-server-ver17"&gt;&lt;code&gt;sys.dm_db_index_operational_stats&lt;/code&gt;&lt;/a&gt; returns lower-level data access, locking and latching statistics for each partition of a table or index. Because it reports per index, it can tell you which index the row-lock waits belong to.&lt;/p&gt;</description></item></channel></rss>