How to find the worst performing queries in MS SQL Server 2008?
- by Thomas Bratt
How to find the worst performing queries in MS SQL Server 2008?
I found the following example but it does not seem to work:
SELECT TOP 5 obj.name, max_logical_reads, max_elapsed_time
FROM sys.dm_exec_query_stats a
CROSS APPLY sys.dm_exec_sql_text(sql_handle) hnd
INNER JOIN sys.sysobjects obj on hnd.objectid = obj.id
ORDER BY max_logical_reads DESC
Taken from:
http://www.sqlservercurry.com/2010/03/top-5-costly-stored-procedures-in-sql.html