DF210: The SET NOCOUNT OFF statement is used.

The topic describes the DF210 T-SQL code analysis rule.

Category

PERFORMANCE

Message

The SET NOCOUNT OFF statement is used.

Description

Turning off the NOCOUNT setting is not recommended, as it results in sending unnecessary messages to the client.

Additional information

It is important to note that turning off the NOCOUNT setting is generally not recommended. This setting suppresses the “xx rows affected” message that SQL Server sends to the client after executing statements. By leaving NOCOUNT on, unnecessary messages are avoided, reducing network traffic and potentially improving performance, especially in scenarios involving multiple statements or large result sets.

Noncompliant code example

CREATE PROCEDURE dbo.DemoProc
AS
BEGIN
    SET NOCOUNT OFF;
    SELECT * FROM dbo.DemoTable
END
GO

Compliant solution

CREATE PROCEDURE dbo.DemoProc
AS
BEGIN
     
    SELECT * FROM dbo.DemoTable
END
GO

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?