returning to default LOCK_TIMEOUT
After doing a SET LOCK_TIMEOUT
in an SQL query is it possible to return to the default timeou开发者_如何学Got? Or rather the default timeout as it was defined by the DBA?
The default is -1 which means "no timeout"
To reset it to the previous value that may not be the default in that connection, store the value from @@LOCK_TIMEOUT
and change it back later. You'll need dynamic SQL.
However, it's reset when the connection is dropped as per SET LOCK_TIMEOUT
At the beginning of a connection, this setting has a value of -1. After it is changed, the new setting stays in effect for the remainder of the connection.
So, unless you persist the connection indefinitely you don't need to do anything...
精彩评论