Keeping an eye on contention In SQL Server, I am using the following command to see blocked sessions: 

select * from sys.sysprocesses where blocked&gt;0


This is super. The problem is I need to see what block sessions there were in the last 30 minutes.  This isn't easy because, the blocked sessions can be come unblocked.can go a so they won't be returned by :

select * from sys.sysprocesses where blocked&gt;0


Any ideas?

Thanks
Adam Machanic wrote the everuseful sp_whoisactive that can handle the task. A description of the procedure can be found at SP_WhoIsActive: Get detailed information about the sessions running on your SQL Server system