Blocking Query

  • Hi Team,

    I used to run 'sp_who2' to check the locks, i found that some sp_id are showing in BlkBy column, and in command column it is showing as 'Select'

    I to find the full query, which is blocked.

  • one method is to use dbcc inputbuffer

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • hi,

    Using DBCC INPUTBUFFER(<spid>)

    but am not getting the full query.

  • Is your query running a loop, cursor or does it have multiple batches within it?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Hi Jason,

    there is no Loop and cursors, it is a simple select query, is there any other way (without using 3rd party tools) to get the full query which is Blocked.

    Please suggest.

  • You can try the query in this article

    http://www.sqlservercentral.com/articles/sp_who2/70222/

    You can also try sp_whoisactive (link in the discussion on that article.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thank You Jason,

    i'll check the link and revert back if any queries.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply