<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Contention on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/contention/</link><description>Recent content in Contention on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Fri, 17 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/contention/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server TempDB Usage and Contention Report</title><link>https://www.sqlserver70.com/post/sql-server-tempdb-usage-contention-report/</link><pubDate>Fri, 17 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-tempdb-usage-contention-report/</guid><description>
&lt;p&gt;TempDB is a shared system database used by every session in SQL Server. When TempDB space grows or performance slows, it can be difficult to know which sessions are responsible. This script queries &lt;code&gt;sys.dm_db_session_space_usage&lt;/code&gt; to show a clear breakdown of TempDB consumption per session, including the current SQL statement being run.&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;TempDB is used for temporary tables, table variables, sort operations, hash joins, cursors, and row versioning. Any session can allocate TempDB space, and heavy use can cause disk pressure or contention on allocation pages (GAM, SGAM, PFS).&lt;/p&gt;</description></item></channel></rss>