The topic describes the DF210 T-SQL code analysis rule.
PERFORMANCE
The SET NOCOUNT OFF statement is used.
Turning off the NOCOUNT setting is not recommended, as it results in sending unnecessary messages to the client.
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.
CREATE PROCEDURE dbo.DemoProc
AS
BEGIN
SET NOCOUNT OFF;
SELECT * FROM dbo.DemoTable
END
GO
CREATE PROCEDURE dbo.DemoProc
AS
BEGIN
SELECT * FROM dbo.DemoTable
END
GO