@@LOCK_TIMEOUT – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Wed, 16 May 2012 07:12:55 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Using @@LOCK_TIMEOUT https://sqlserverlearner.com/2012/05/16/using-lock_timeout/ https://sqlserverlearner.com/2012/05/16/using-lock_timeout/#respond Wed, 16 May 2012 07:12:55 +0000 https://sqlserverlearner.azurewebsites.net/2012/05/16/using-lock_timeout/ @@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

]]>
https://sqlserverlearner.com/2012/05/16/using-lock_timeout/feed/ 0