<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Network on Rudi Bruchez</title><link>https://www.pachadata.com/en/tags/network/</link><description>Recent content in Network on Rudi Bruchez</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 09 Nov 2026 14:57:42 +0100</lastBuildDate><atom:link href="https://www.pachadata.com/en/tags/network/index.xml" rel="self" type="application/rss+xml"/><item><title>SET NOCOUNT ON and performance</title><link>https://www.pachadata.com/en/docs/questions/set-nocount-on-performance/</link><pubDate>Sat, 07 Nov 2026 00:00:00 +0000</pubDate><guid>https://www.pachadata.com/en/docs/questions/set-nocount-on-performance/</guid><description>&lt;p&gt;&lt;em&gt;Co-written with Claude, who ran the testing and research.&lt;/em&gt;&lt;/p&gt;&#10;&lt;div class="alert alert-success" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;TL;DR&lt;/div&gt;&#10;&lt;p&gt;Without &lt;code&gt;SET NOCOUNT ON&lt;/code&gt;, a procedure that runs 100,000 &lt;code&gt;UPDATE&lt;/code&gt; statements in a loop sends 3.9 MB to the client; with it, 75 bytes. These messages go out in full packets, one after the other, without waiting for a reply: so there is no impact on query execution performance. But they cost bandwidth.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;h2 id="the-question"&gt;The question&lt;/h2&gt;&#10;&lt;p&gt;A common best practice for stored procedures is to always start them with &lt;code&gt;SET NOCOUNT ON&lt;/code&gt;, which stops SQL Server from sending the client, after each statement, the message that gives the number of rows affected (the &amp;ldquo;(1 row affected)&amp;rdquo; in SSMS).&#10;This message is the &lt;code&gt;DONE_IN_PROC&lt;/code&gt; token of the TDS protocol. The &lt;a href="https://learn.microsoft.com/sql/t-sql/statements/set-nocount-transact-sql"&gt;&lt;code&gt;SET NOCOUNT&lt;/code&gt; documentation&lt;/a&gt; says it &amp;ldquo;can provide a significant performance boost&amp;rdquo; for procedures that contain loops, because network traffic is greatly reduced. The &lt;a href="https://learn.microsoft.com/sql/t-sql/statements/create-procedure-transact-sql"&gt;&lt;code&gt;CREATE PROCEDURE&lt;/code&gt;&lt;/a&gt; documentation says the opposite: there is no measurable performance benefit on today&amp;rsquo;s hardware.&lt;/p&gt;</description></item></channel></rss>