This SP will give a listing of users blocking and being blocked in a tree formation (similar to explorer tree list). It uses a User defined function that recurses through the locking information gathered from sysprocesses. The listing only shows the Hostname (username) and the SPID.
First create the User Defined Function (Part One) then create the (U)SP. Usage "Exec USP_LOCKTREE" (sans quotes).
Drop all connections from a specific database.
2007-10-19 (first published: 2007-07-25)