sql set nocount on和off [英] sql set nocount on and off

查看:96
本文介绍了sql set nocount on和off的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sql set nocount on和off,它在存储过程中的用途是什么时候使用它们应该使用强制

推荐答案

你好,


SET NOCOUNT停止显示受Transact-SQL语句或存储过程影响的行数的消息,作为返回的一部分结果集



是否要打开或不打开取决于存储过程的逻辑。通常,T-SQL ddocumentation建议对于包含许多不返回大量实际数据的状态的存储过程,或者对于包含Transact-SQL循环的过程,NOCOUNT应设置为ON。这有助于提高性能,因为网络流量大大减少了。



问候,
Hello,

SET NOCOUNT Stops the message that shows the count of the number of rows affected by a Transact-SQL statement or stored procedure from being returned as part of the result set.

Whether you want to turn it ON or Not depends upon the logic of the stored procdeure. In general T-SQL ddocumentation recommendes that for stored proedures containing many statments that do not return much actual data, or for procedures that contain Transact-SQL loops, NOCOUNT shoule be set to ON. This helps in boosting performance because Network traffic is reduecd considerably.

Regards,


这篇关于sql set nocount on和off的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆