Monday, April 12, 2010

Find the state of the process and count on each scheduler

-- Find the state of the process and count on each scheduler


select count(*) noofrows ,t1.state as processorstate, t2.scheduler_id
from sys.dm_os_workers as t1, sys.dm_os_schedulers as t2
where t1.scheduler_address = t2.scheduler_address
and t2.scheduler_id < 255
group by t2.scheduler_id,t1.state
order by scheduler_id

No comments: