5.12.13

Blocked processes: Quick Tips

Sometimes activity monitor just isn't fast enough. Maybe it's not telling you what a specific query is doing. Below is a quick script just to get a glimpse into what is going on. This could be very useful if activity monitor decides not to load.... again.

First, what's blocking?

select * from sysprocesses
order by blocked desc

Well well... what's spid 148 doing?

select * from sysprocesses p
cross apply sys.dm_exec_sql_text(sql_handle)
where p.spid = 148

This will give you what that query is running if you scroll to the far right.

There are more robust scripts such as Adam Machanic's script, 'Who Is Active". It honestly does a much better job. The above is just something quick to get specific information in a small amount of time.


Really quick post it seems. Don't forget, the next giveaway starts Monday!.


No comments:

Post a Comment

All opinions welcome! Please comment with any changes thoughts or discussion points.