Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to Microsoft SQL Server Request SQLWays

SQL Server - SET LOCK_TIMEOUT Statement

SQL Server - SET LOCK_TIMEOUT Statement
Syntax SET LOCK_TIMEOUT milliseconds
Description SET LOCK_TIMEOUT defines how to handle a process that tries to access a locked row or table.

-1 - the server waits forever (no timeout). This is the default behavior for locking.
0 - the server ends the operation immediately and returns an error.
milliseconds - waits the specified number of milliseconds and returns an error code if the lock not released.

Examples:

SET LOCK_TIMEOUT 0         -- returns an error immediately if a resource locked     
SET LOCK_TIMEOUT -1        -- wait until the lock releases
SET LOCK_TIMEOUT 31000     -- wait no more than 31 seconds until the lock releases

Equivalents in Other Databases

Database Equivalent Notes
Informix SET LOCK MODE Statement Time in seconds, default is NO WAIT (timeout is 0)


Ispirer Home Page Ispirer SQLWays Product Page - Migration to Microsoft SQL Server Request SQLWays

sqlways/sql-server/set-lock-timeout.txt · Last modified: May 07, 2018, 03:15:32 PM (external edit)
 
© 1999-2021, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement