SET NOCOUNT
suppresses 'rows affected' messages; @@ROWCOUNT still updated
What changes
- Input
- none
- Output or change
- session state
Syntax at a glance
SET NOCOUNT { ON | OFF }
Work example
A stored procedure should avoid sending row-count messages that its caller does not use.
Test the client response with NOCOUNT on and off. Keep the setting inside the procedure when that is its intended scope.
Check your work SET NOCOUNT. The result sets remain unchanged and the client receives no unwanted row-count messages.
Open Microsoft Learn for full syntax, permissions, and details for your version.