How to find the worst performing queries in MS SQL Server 2008?

Posted by Thomas Bratt on Stack Overflow See other posts from Stack Overflow or by Thomas Bratt
Published on 2010-03-23T12:44:58Z Indexed on 2010/03/23 12:53 UTC
Read the original article Hit count: 212

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

© Stack Overflow or respective owner

Related posts about Performance

Related posts about sql-server-2008-express