How can we see long running queries with Tsql… | SQL Server Performance Forums
SQL Server Performance Forum – Threads Archive
How can we see long running queries with Tsql…Hi,
Can anybody tell how can we see long running queries with tsql i have query for sql 2005 but it doesnt work with 2000.
so plz help me Regards
This will help you with cpu.
SELECT * FROM master..sysprocesses WHERE status = ‘runnable’ ORDER BY cpu desc
DBCC INPUTBUFFER (53) DECLARE @handle binary(20) SELECT @handle = sql_handle FROM master..sysprocesses WHERE spid = 53 SELECT [text] FROM ::fn_get_sql(@handle)
Really thaxx for ur help but i want to see like which is long running query .like we can see in sql 2005 which queries running long bcuase is sql 2005 there is dmv of query status but i dont know how can we see in sql 2000 .
Only option would be SQL Server profiler/trace to get the list of long running procedures/queries. Save the profile data into files then export them into a table to get the info by quering it…
Note: You see the information in profiler only when it is completed but not when it is in progress.
Profiler does not help you?