In the stored procedure, the set NOCOUNT on is often used;
Effect: Prevents the return of row count information in the result set that is displayed by T-SQL statements or by USP.
When set Oncount on, the count is not returned, when set NOCOUNT off, the count is returned;
Update @ @RowCount Even when set NOCOUNT on;
When set NOCOUNT on, the DONE_IN_PROC message for each statement of the stored procedure will not be sent to the client, and if the stored procedure contains statements that do not return actual data, network traffic will be greatly reduced, which can significantly improve application performance;
Set NOCOUNT the specified setting takes effect during execution or runtime and does not take effect when parsing.
1 ///when there is too much data, using NOCOUNT can not return the number of rows affected, for optimization purposes:2 3 SetNOCOUNT on;4 5 INSERT intoPrc_xoem_stor_sr_data_raw (STOR_ID,SLSPRS_ID,SLSPRS_NM,LST_UPT_DTM)6 Select'7836','20438','Test','2016-05-03'UNION All7 Select'96558','20438','Test','2016-05-03'UNION All8 Select'101377','20438','Test','2016-05-03'UNION All9 .Ten . One . A Select'101431','20438',"','2016-05-03'UNION All - Select'101573','20438',"','2016-05-03' - SetNOCOUNTOFF
SQL Sage Road Note--sql storage process Optimization Nocount