gpt4 book ai didi

sql-server - 在 SQL Server 查询中关闭 NOCOUNT 有哪些优点和缺点?

转载 作者:行者123 更新时间:2023-12-02 07:23:38 26 4
gpt4 key购买 nike

在 SQL Server 查询中关闭 NOCOUNT 有何优点和缺点?

最佳答案

来自 SQL BOL:

SET NOCOUNT ON prevents the sending of DONE_IN_PROC messages to the client for each statement in a stored procedure. For stored procedures that contain several statements that do not return much actual data, setting SET NOCOUNT to ON can provide a significant performance boost, because network traffic is greatly reduced.

参见http://msdn.microsoft.com/en-us/library/ms189837.aspx了解更多详情。
另外,这篇关于 SQLServerCentral 的文章在这个主题上也很精彩:
Performance Effects of NOCOUNT

关于sql-server - 在 SQL Server 查询中关闭 NOCOUNT 有哪些优点和缺点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26552/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com