title: How to find the worst performing queries in SQL Server 2008?
body: <p>How to find the worst performing queries in SQL Server 2008?</p>
  
  <p>I found the following example but it does not seem to work:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Taken from:</p>
  
  <p><a href="http://www.sqlservercurry.com/2010/03/top-5-costly-stored-procedures-in-sql.html" rel="noreferrer">http://www.sqlservercurry.com/2010/03/top-5-costly-stored-procedures-in-sql.html</a></p>