blcoked processes

  • Hi all,

    how can i find out what SQL process is runnig byt the SPID which is blocking other users?

    Thanks

    Pat

  • plz use the below

    select * from master..sysprocesses where blocked > 0

    or

    select spid,blocked from master..sysprocesses where blocked > 0

    go

    sp_who2 (SPID)

  • Hi,

    I got that which SPID is blocking but I need to have see the Process that is running or TextData

    Thanks

    Pat

  • PLease use below

    dbcc inputbuffer(spid)

  • SQL 2000 use this:

    DECLARE @Handle binary(20)

    SELECT @Handle = sql_handle FROM sysprocesses WHERE spid = (paste the spid here)

    SELECT * FROM ::fn_get_sql(@Handle)

    SQl 2005

    select ss.text,sp.*

    from master..sysprocesses sp

    cross apply sys.dm_exec_sql_text (sp.sql_handle) ss

    where sp.spid in (select spid from master..sysprocesses where blocked 0)

Viewing 5 posts - 1 through 4 (of 4 total)

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