有没有办法让存储过程不断刷新它们的超时过期TSQL?
我编写了一个相当复杂的存储过程,运行大约需要 2 分钟(Is 是单个 Update 语句)。然而,在这 2 分钟的时间内,存储过程超时了。我想知道是否有办法刷新存储过程超时过期,这样我就不必将服务器超时更改为 30 秒。我无法真正分解存储过程,因此运行多个较小版本的存储过程有点不可能。最好在存储过程中的某个地方说,例如每次存储过程成功更新一行时,刷新计时器,以便它可以更新所有行而不会超时。任何建议将不胜感激。谢谢。
I wrote a pretty complex Stored Procedure that takes about 2 minutes to run (Is is a single Update statement). However, in this 2 minutes of time the stored procedure times out. I was wondering if there was a way to refresh the Stored Procedures timeout expiration so that I don't have to change the servers timeout from 30 seconds. I cannot really break the stored proc up any more than it already is so running multiple smaller versions of the stored proc is kind of off the table. It would be nice to say somewhere in the stored procedure like every time the stored proc successfully updates a row, refresh the timer so that it can update all the rows without timing out. Any advice would be appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。命令超时纯粹是
您需要增加调用代码中的
CommandTimeout
。No. The command time out is purely a client side thing.
You would need to increase the
CommandTimeout
in the calling code.