I am experiencing a blocking issue in sql server 2005. An end user executes a query (e.g. select statements) and seems to get into a never-ending blocking until i kill the process e.g. for hours on end .
the end user querys run just fine when I test the. It seems to get into a blocking issue when qanother process tries to truncate and reload a table.
how can I troubleshoot this?
SELECT-ing from a table that has beenTRUNCATE-d by another still open transaction then yes it will be blocked. Are you saying the blocking continues even after that other transaction is completed? – Martin Smith Jan 4 at 12:43SELECTis itself blocked by something else (look insys.dm_os_waiting_tasks) or sometimes it gets a catastrophically bad plan that means it is actually doing much more work (e.g. parameter sniffing). You say "the end user querys run just fine when I test" so sounds like the second one. Compare and contrast the execution plans from both sessions. – Martin Smith Jan 4 at 12:57