Thursday, 29 February 2024

Dead lock in SQL

 SELECT *   FROM sys.dm_tran_active_transactions;


A deadlock is a situation in a database system where two or more transactions are waiting indefinitely for each other to release resources that they need to proceed. This creates a circular dependency, causing each transaction to be blocked from completing, resulting in a deadlock situation.

Here's a simplified explanation of how a deadlock can occur:

  1. Transaction A holds a lock on Resource X and needs a lock on Resource Y to complete.
  2. Transaction B holds a lock on Resource Y and needs a lock on Resource X to complete

No comments:

Post a Comment

c#

 https://github.com/dcyuksel/Result