To find recently executed queries in SQL Server

 
To find recently executed queries,
 
Select dmStats.last_execution_time as 'Last Executed Time',dmText.text as 'Executed Query' from sys.dm_exec_query_stats as dmStats Cross apply sys.dm_exec_sql_text(dmStats.sql_handle) as dmText Order By
dmStats.last_execution_time desc
 
Cheers,
Ebook Download
View all
SQL Jobs
Read by 0 people
Download Now!
Learn
View all