Microsoft SQL Server uses locking to ensure the integrity of transactions and consistency in the database. Locking prevents data that users are reading from being changed by other users, and prevents multiple users from simultaneously changing the same data. If locking is not used, data within a database may become incorrect, and queries executed against that data may produce unexpected or invalid results. SQL Server automatically applies locks. However, you can make your applications more efficient by customizing or minimizing database locking.

The SQL Server Locks object provides information about locks that are applied to individual resource types. Locks are held on SQL Server resources such as rows read or rows that were modified during a transaction, and prevent the concurrent use of a resource by multiple transactions.

SQL Server can lock the following resources:

DatabaseA database
ExtentA contiguous group of eight data pages or index pages.
KeyA row lock within an index.
PageAn eight kilobyte data page or index page.
RIDThe identifier for a row in the database.
TableAn entire table in the database, including all data and indexes.

SQL Server locks resources using the following resource lock modes:

Related Documentation

Configuring SQL Server Ports

Verifying the Configuration of SQL Server Ports