After doing a SET LOCK_TIMEOUT in an SQL query is it possible to return to the default timeout? Or rather the default timeout as it was defined by the DBA?
After doing a SET LOCK_TIMEOUT in an SQL query is it possible to return
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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_TIMEOUTand change it back later. You’ll need dynamic SQL.However, it’s reset when the connection is dropped as per SET LOCK_TIMEOUT
So, unless you persist the connection indefinitely you don’t need to do anything…