Hi
What is the Deadlock and Live Lock in SQL Server. How will you go about the Resolving Deadlocks ?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Apr 19, 2012, 10:08 PM EDT
For more info:
http://dba.fyicenter.com/Interview-Questions/SQL-Server-DBA/What_is_a_deadlock_and_what_is_a_live_lock_How_.html
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 22, 2012, 7:58 PM EDT
Deadlock occurs when two users have locks on separate objects and each user wants a lock on the other's object. When this happens, SQL Server ends the deadlock by automatically choosing one and aborting the process, allowing the other process to continue.
For live lock please refer,
http://blog.sqlauthority.com/2008/03/21/sql-server-introduction-to-live-lock-what-is-live-lock/
To avoide Deadlocks
- Minimize the size and time of transaction.
- use nolock and rowlock with query if possible
select * from table1 (nolock)
- Select deadlock victim by using SET DEADLOCK_PRIORITY.
hope this help.