Tuesday, July 25, 2006

Using System Tables 1 : Oh!!! which processes are taking most CPU time

Master...sysprocesses

This command gives you an inside depth of which process is running the CPU process very high


SELECT * FROM master..sysprocesses WHERE status = 'runnable' ORDER BY cpu desc

When you get the spid you can get the input command from the following


DBCC INPUTBUFFER(spid)

which gives you what statement the end user has been running.


KILL spid would close or kill the process automatically

The other notable columns in this table are

  • nt_username
  • loginname
  • hostname

No comments: