Here's a simple one to show you real time what is executing on the server.

set transaction isolation level read uncommitted
go
SELECT  s.blocked as blockedBy, r.session_id,
    st.text, r.status, r.command, r.cpu_time,
    db_name(r.database_id),
    object_name(st.objectid, r.database_id), r.start_time,
datediff(ss,r.start_time,getdate()) as Seconds
    ,r.reads, r.writes, r.logical_reads
FROM sys.dm_exec_requests r
    outer APPLY sys.dm_exec_sql_text(sql_handle) AS st
    left outer join master.dbo.sysprocesses s on s.spid = r.sessioN_id
where st.text is not null
    or exists (select * from master.dbo.sysprocesses where spid = s.blocked)
order by session_id

Byron Mann
Lead Engineer & Architect
HostMySite.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355926
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to