- SET NOCOUNT ON only suppresses the "X rows affected" messages that SQL Server would otherwise send back to the client after each INSERT, UPDATE, DELETE, or SELECT. In another word, the only effect of NOCOUNT ON is that the client won’t see “(10 rows affected)” messages, which improves performance in procedures with many statements.
- SET NOCOUNT ON does not interfere with @@ROWCOUNT; It does not stop you from counting rows or using the result set inside the procedure.
- If You have a SELECT AND SELECT still executes normally, and you can still get the row count using @@ROWCOUNT immediately after the SELECT.
Clarification about 'SET NOCOUNT ON' to count rows inside the stored procedure
Seyed Hamed Vahedi
Thu, 27 November, 2025