July 24, 2003 08:24 PM

Track Down Troublemakers

Use sysprocesses to identify blocking processes
Rating: (0)
SQL Server Magazine
InstantDoc ID #39453
Every process, whether user-initiated or internal to SQL Server, is constantly acquiring and releasing locks. Most of the time, locks don't cause problems. In fact, locks prevent problems that would arise if processes were able to make changes to data that other processes are in the middle of modifying. Locking problems arise only when a process holds a lock longer than necessary, or longer than another user would like, and blocks other users' processes. To those users, their processes are blocked—unable to retrieve or modify data.

Sys...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

Very Useful

David4/10/2008 10:55:35 AM


If all you want to know is who is blocking and who is blocked, you can of course get that information from the Current Activity window of the Enterprise Manager.
However, there are two reasons to be aware of the code that can give you the same info:

1. You can customize the code to give you exactly the info you want, including joining the locking table and the process table to other tables to get even more information. In addition, you can save output from queries in a tabular format for later analysis or trend evaluation.
2. On a busy system (which you frequently have when trying to track down blocking problems) there is an enormous overhead to using the Enterprise Manager Current Activity window and some people find that using that GUI on a busy actually creates more blocking problems and the Current Activity Window itself can end up hanging and never returning the information you’re interested in.


Kalen Delaney
www.SolidQualityLearning.com

Diana12/5/2006 9:37:53 AM


While this article is useful in determining how to use command line to get at blocking queries, isnt all this information already available in Enterprise Manager-->Current Activity-->Locks/Process ID

This should list out all the processes, and you should be able to trace all the way to the top SPID of the blocker.

What advantage does querying sysprocesses have over using the EM provide? Both have to be done in the same time frame?

Sabin12/4/2006 12:56:20 PM


Very helpful. Karen's always been my favorite!

DANIEL12/3/2006 5:42:23 PM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS