Reputation: 23
In MSSQL stored procedures, when writing an aggregated query such as "SELECT COUNT(*) ...." are the results adversely affected by the NOCOUNT ON setting? Or, will it just not show "1 rows"?
Upvotes: 0
Views: 171
Reputation: 34
The SET NOCOUNT ON; only avoid to list a message that displays in the message tab (in SSMS). Is recommended (as best practices) that an application in production uses the SET NOCOUNT ON cause this is only used for debug environments.
The SELECT COUNT() doesn't have anything related to SET NOCOUNT, it only shows the "(1 row affected)" by the SELECT COUNT()
Upvotes: 1