SQL queries execution time

The view sys.dm_exec_query_stats will have statistical information of the cached queries.
The view sys.dm_exec_sql_text will show the actual query executed.

The output will show the results based on the time, the query takes to run,
which you can identify and improve upon.


SELECT
   txt.text, total_elapsed_time
FROM
   sys.dm_exec_query_stats stat
   CROSS APPLY sys.dm_exec_sql_text (stat.sql_handle) txt
ORDER BY
   total_elapsed_time desc