Friday, 16 January 2009

SQL Server monitoring rogue processes

Run one of these queries to check if there are any SPIDs with Blocked Status or High CPU time. It also shows the hostname, loginname, logintime info.

SELECT * FROM sys.sysprocesses
-- or this one
Sp_who2 

Run this command to get the SQL for a SPID

DBCC INPUTBUFFER (<SPID>)

Run this command to get more info about the lock

EXEC SP_LOCK <SPID>

No comments:

Post a Comment