Using the SET NOCOUNT SQL Method

Using the SET NOCOUNT SQL Method

Whenever an SQL query has been executed it usually returns the number of rows as well as a short message. Sometimes when working with multiple Stored Procedures, each having multiple statements, you can quickly end up with a very long list of “Rows Affected” messages, or sometimes you simply do not need to know how many rows have been affected.

By switching off the DONE_IN_PROC messages you can actually boost the performance of queries and network traffic. To use NOCOUNT all you need to do is to add this statement above your query (wherever the query may be):


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist