When set nocount is on, no count is returned (indicating the number of rows affected by the transact-SQL statement ).
When set nocount is off, return count (default value: off ).
Even if set nocount is on, the @ rowcount function is updated.
When set nocount is on, the done_in_proc information of each statement in the stored procedure is not sent to the client. When you use a utility provided by Microsoft SQL server to execute a query) at the end of the query, "Nn row affected" is not displayed in the query results ".
If some statements contained in the stored procedure do not return much actual data, this setting greatly reduces network traffic and significantly improves performance.
Set nocount is set during execution or runtime, rather than during analysis.
Note: When set nocount is on, no count is returned (indicating the number of rows affected by the transact-SQL statement ). When set nocount is off, return the count. ...
Conclusion:We should add set nocount on to the header of the stored procedure, and add set nocount off when exiting the stored procedure to optimize the process...