Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Compliance with SQL standards [Table of Contents] Using the wait/nowait options
of the lock table command

Transact-SQL User's Guide

[-] Chapter 18 Transactions: Maintaining Data Consistency and Recovery
[-] Selecting the transaction mode and isolation level
[-] Using the lock table command to improve performance

Using the lock table command to improve performance

The lock table command allows you to explicitly request that before a table is accessed, a table lock be put on it for the duration of a transaction. This is use useful when an immediate table lock may reduce the overhead of acquiring a large number of row or page locks and save overall locking time. Examples of such cases are:

Syntax of the lock table command

The syntax of lock table is:

lock table table_name in {share | exclusive} mode
          [wait [no_of_seconds] | nowait]

The wait/nowait option allows you to specify how long the command waits to acquire a table lock if it is blocked (see "Using the wait/nowait options of the lock table command").

The following considerations apply to the use of lock table:


Compliance with SQL standards [Table of Contents] Using the wait/nowait options
of the lock table command