SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Retrieve locking block-chain

By John Liu, 2008/09/02

Total article views: 1174 | Views in the last 30 days: 46

In SQL2000 or earlier version, it's not easy to build up a accurate locking block chain when needed. The introducing of DMV and Cross Apply in SQL2005 gives DBA the flexibility of quickly building up the accurate locking block chain. One can then join this chain with other DMVs to return the information most interested to them. In this code, I have joined the chain with the sys.dm_exec_sessions DMV to return the host_name, login_name information to see who is blocking whom.

 

(04 Sep: Removed Tab in the code)

By John Liu, 2008/09/02

Total article views: 1174 | Views in the last 30 days: 46
Your response
 
 
Related Articles
FORUM

blocking

blocking

FORUM

Blocking

Blocking & Blocked by

FORUM

Retrieve locking block-chain

Comments posted to this topic are about the item [B]Retrieve locking block-chain[/B] Nice code brah...

SCRIPT

Parse the dependency chain of an object

Parses up & down the dependency chain of an object

Tags
locking    
 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com