-- Contention
use tempdb

-- Examine the waiting tasks view
select * from sys.dm_os_waiting_tasks

-- Query for blocking requests
select 
		dbo.sql_text(r.sql_handle, r.statement_start_offset, r.statement_end_offset),
		wt.* 
	from 
		sys.dm_os_waiting_tasks wt
		join
		sys.dm_exec_requests r
		on
		wt.session_id = r.session_id
	where 
		r.connection_id is not null