- What are the possible situations which make deadlock happen on SQL server?
- How to solve with that situation?
views:
162answers:
2
A:
A really simple explanation when a Dead Lock happen (when ive got it wrong, sorry im no DBA :) ):
Both Transaction run parallel
Transaction 1
Select * From Table1 Select * From Table2
Transaction 2
Select * From Table2 Select * From Table1
T1 waits for Table2 and T2 waits for Table1
One optimization is to do the SQL Statements in the same Order. MSSQL Sever has an Option with nolock, but there you have the Dange of inconsitent data.
Richard
2009-06-25 09:49:15