Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Currently running sql statements

Author  Topic 

rohitmathur11
Yak Posting Veteran

77 Posts

Posted - 2009-11-14 : 04:13:32
Hi,
How can i find current running sql statements in the database.
i am using follwoing ,but it is show this select statement only..
Please advise...


SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext



oracle

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-23 : 09:36:09
Try this


SELECT top 10 sqltext.TEXT,
req.*
FROM sys.dm_exec_query_stats req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
order by last_execution_time desc


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rohitmathur11
Yak Posting Veteran

77 Posts

Posted - 2009-11-24 : 05:05:00
Thanks a lot ..now it is showing other sql staements ..



oracle
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-25 : 00:58:58
quote:
Originally posted by rohitmathur11

Thanks a lot ..now it is showing other sql staements ..



oracle


You are welcome

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -