Locking in SQL Server :-
Locking resolves of concurrent access where concurrent access means accessing same data by the number of users at same time.
The following problem occurs concurrent access:
- dirty read
- last update
Locks types are Two types:
- Shared lock -> It is denoted by (‘s’)
- exclusive lock -> it is denoted by ‘x’
- Shared lock is placed when ever user to trying read the database. [i:e select]
- Exclusive lock is placed when ever you have to trying update the database [i:e update]
- Update lock (u):This lock is placed when ever user is try to update the database item but this is placed before placing exclusive lock.