In multiuser environments, the DBMS ensures the integrity of the data by setting write locks on all the tables you are updating. This prevents other users from making changes to the same tables.

Table Locking

While write operations automatically lock a table during updates, you can explicitly lock a table, even if you are not performing a write operation. By locking a table immediately before accessing a record, you are assured that the data you might change in the record conforms to the data you have read, even if some time has elapsed. A write lock does not influence data retrieval. This means that locking a table does not prevent other users from gaining read access to the records in the table.

For information on managing locks SQL Server, see Locking in the Database Engine. (for SQL Server 2008) or Understanding Locking (for SQL Server 2005).

In Classic Database Server, a write lock is active until the write transaction is either aborted or committed.

See Also