本文介绍了SQL Server的错误列表,应重试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有SQL Server存储过程的错误意义的自动重试的简明列表?很显然,一个重试登录失败的错误是没有意义的,但是在重试超时一样。我想这可能是更容易地指定要重试,而不是指定不重试它的错误,是错误的。

Is there a concise list of SQL Server stored procedure errors that make sense to automatically retry? Obviously, retrying a "login failed" error doesn't make sense, but retrying "timeout" does. I'm thinking it might be easier to specify which errors to retry than to specify which errors not to retry.

那么,除了超时的错误,还有什么其他错误,将是很好的候选人自动重试?

So, besides "timeout" errors, what other errors would be good candidates for automatic retrying?

谢谢!

推荐答案

您应该重试(重办)整个事务,而不仅仅是一个单一的查询/ SP。至于重试错误,我一直在使用下面的列表:

You should retry (re-run) the entire transaction, not just a single query/SP.As for the errors to retry, I've been using the following list:

DeadlockVictim = 1205,
LockRequestTimeout = 1222,
OutOfMemory = 701,
OutOfLocks = 1204,
TimeoutWaitingForMemoryResource = 8645,

其中最重要的当然是死锁牺牲品错误1205。

The most important one is of course the "deadlock victim" error 1205.

这篇关于SQL Server的错误列表,应重试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:41