Using @@LOCK_TIMEOUT

Posted on : 16-05-2012 | By : Devi Prasad | In : SQL SERVER VARIABLES

Share:

0


@@LOCK_TIMEOUT specifies the number of milliseconds a statement has to wait for the lock on the dependant objects to be released.

Syntax:
[sql]
SET @@LOCK_TIMEOUT [time_out_in_milli_seconds]
[/sql]

Example:
Below example sets the lock timeout to 2000 milli seconds(2 seconds).
[sql]
SET @@LOCK_TIMEOUT 2000
[/sql]

By default the initial value of @@LOCK_TIMEOUT is -1.

@@LOCK_TIMEOUT setting is not applicable to the following:
CREATE DATABASE Statement
ALTER DATABASE Statement
DROP DATABASE Statement

MSDN Link: http://msdn.microsoft.com/en-us/library/ms189470.aspx

Applicable to SQL Server 2000,SQL Server 2005,SQL Server 2008,SQL Server 2008 r2,SQL Server 2012




References : Devi Prasad (sqlserverlearner.com)

Need Help On SQL Server?

Cannot Find Solution to your problem (or) If you are looking for some help on SQL Server. Dont worry Click Here to Post your question and solve your issue.


Do you like my blog?

If you liked reading this blog, please help spread the word by sharing this blog with your friends.




Write a comment



Tags: , , , , , , , ,