Script to list out all recently ran queries in SQL Server
SELECT deqs.last_execution_time AS [Time]
,dest.TEXTAS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle)AS dest
ORDERBY deqs.last_execution_time DESC
No comments:
Post a Comment