Find blocking process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • neo

    Find blocking process

    Hi,
    we're having a problem with SQL 2000 and Opta 2000 JDBC driver
    where there is large update running and at the same time,
    read is blocked for a while.
    We're looking for a way to catch this blocking process
    and if it last more than 10 minutes, then email or send out a message.
    I know sp_lock returns all current locks
    but how do you know which one is blocking other processes?

    Thanks for your help in advance.
  • Erland Sommarskog

    #2
    Re: Find blocking process

    neo (second714@hotm ail.com) writes:[color=blue]
    > we're having a problem with SQL 2000 and Opta 2000 JDBC driver
    > where there is large update running and at the same time,
    > read is blocked for a while.
    > We're looking for a way to catch this blocking process
    > and if it last more than 10 minutes, then email or send out a message.
    > I know sp_lock returns all current locks
    > but how do you know which one is blocking other processes?[/color]

    The simplest way is to use sp_who. If a process is blocked, you will
    see a non-zero value in the Blk column. This is the spid of the blocker.


    --
    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

    Books Online for SQL Server SP3 at
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    Working...