Use below query to get recently run queries
SELECT DEQS.last_execution_time as [Time], DEST.text as [Query]
FROM
sys.dm_exec_query_stats as DEQS cross apply sys.dm_exec_sql_text(DEQS.sql_handle) as DEST
order by DEQS.last_execution_time DESC
SELECT DEQS.last_execution_time as [Time], DEST.text as [Query]
FROM
sys.dm_exec_query_stats as DEQS cross apply sys.dm_exec_sql_text(DEQS.sql_handle) as DEST
order by DEQS.last_execution_time DESC
No comments:
Post a Comment