I'm using SQL Server 2008 R2 that automatically lock database items based on my queries.
Sometimes this deadlocks - two threads with different queries never ends.
Is there any way to debug how SQL Server locks and unlocks resources? I have tried SQL Trace but it has no information about resources locks.