SQL Server – How to find and kill negative spid

To find out negative spid in sql server, you can use below query. This query will give the negative spid  and kill command. Copy this command and execute against master database to kill negative spid. 

select  distinct convert (smallint, req_spid) As spid,
 DB_NAME(rsc_dbid) As dbname,
 ‘kill  ”’+ cast (req_transactionUOW as varchar(50)) +”” as KillCommand
from  master.dbo.syslockinfo
where req_spid < 0 and req_transactionUOW <> ‘00000000-0000-0000-0000-000000000000’

Leave a Reply

  

  

  


2 + = 11