SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

SP to display locking users in tree format

By kmaclure,

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).

Total article views: 2022 | Views in the last 30 days: 3