Does SET NOCOUNT ON really make that much of a performance difference

后端 未结 3 1253
-上瘾入骨i
-上瘾入骨i 2021-01-11 13:06

In this article, the author suggests that there is material overhead associated with SET NOCOUNT ON and that \"By removing this extra overhead from the network

3条回答
  •  难免孤独
    2021-01-11 13:28

    I agree that using NOCOUNT is a great idea. It is a terrible idea to Add it to all code executed in every SPROC or dynamic SQL statement.

    Especially if you are talking about high performance. TSQL NOCOUNT should be set as needed by the code in the data access layer. Just like transactions and locking levels.

    Setting these things every time in the executing SQL to be executed every time does not give you the great performance boost you could get by setting them in the code of the connecting application.

    Better performance is found by writing better code not by adding SET NOCOUNT statements to all your SQL.

提交回复
热议问题