--Lock
Note:locks in SQL Server are used to control the concurrency of one transaction with another. The system automatically sets or releases the lock for the resource being accessed . If a transaction locks a resource and another transaction accesses the resource, SQL Server determines whether to grant a second lock based on the compatibility of the lock mode used by the first firm.
The locking mode of a resource can be divided into intentional share(IS), share (S), Update (U), intent Exclusive (IX), intent Exclusive Share (SIX) , and Exclusive (X) six different modes.
deadlock behavior : in multiple tasks, if a task locks a resource that other tasks are trying to lock, it can cause permanent blocking of the task, resulting in a deadlock.
---cursor-----cursors overview
Note: The result set for querying results using a SELECT statement is a whole, and cursors can provide this processing mechanism if you want to work with one row or branch of data at a time. Cursors can be understood as pointers. Which record the pointer points to, which record is the one that is being manipulated
Maintenance of SQL Server database (three) __ transactions (transaction) and locks