SET NOCOUNT ON usage

前端 未结 17 1730
抹茶落季
抹茶落季 2020-11-22 05:55

Inspired by this question where there are differing views on SET NOCOUNT...

Should we use SET NOCOUNT ON for SQL Server? If not, why not?

17条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 06:04

    SET NOCOUNT ON;
    

    This line of code is used in SQL for not returning the number rows affected in the execution of the query. If we don't require the number of rows affected, we can use this as this would help in saving memory usage and increase the speeed of execution of the query.

提交回复
热议问题