SQL Server Performance

Record locking

Discussion in 'ALL SQL SERVER QUESTIONS' started by JohnPapa, Dec 30, 2012.

  1. JohnPapa New Member

    Question1: How can a user, say User1, be able to lock a row, say Row1, and any dependent rows, say Row11, Row12, until changes are made to the specific row by User1
    Question2: If another user, say User2, wants to access Row1 or Row11, Row12, when these rows are locked by User1, is there a way to let User1 know about it and in the worst case force the unlock, or have some kind of timeout whne User1 is inactive
    Thanks,
    John
  2. Shehap MVP, MCTS, MCITP SQL Server

    Locks is a mechanism handled by SQL Server Engine itself and it passes locks various escalation levels starting from Row lock, Page locks, Table Lock and Then Database lock according to volume of data acquired by lock and generally speaking about how to resolve locks and deadlocks , you can learn more at my blogs series for this regard where lots of solutions and techniques are explained there to resolve different kinds of locks and deadlocks

    http://www.sqlserver-performance-tu...58684-how-to-resolve-locks-and-deadlocks-2-4-
    http://www.sqlserver-performance-tu...66009-how-to-resolve-locks-and-deadlocks-3-4-
    http://www.sqlserver-performance-tu...66800-how-to-resolve-locks-and-deadlocks-4-4-

    Please let me know if any further help is needed
  3. Luis Martin Moderator

Share This Page