SQL code for viewing last executed commands.
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
Monday, March 23, 2009
How to find last executed queries in SQL server 2005 by SQL Commands
Subscribe to:
Post Comments (Atom)
Great query, thank you!
ReplyDelete