Find the Which Query is Run the Last Time in Sql Server
-
2012年7月21日 上午 05:22
Using below mentioned query to Achive it,
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
- 已變更類型 BalmukundMicrosoft Employee, Moderator 2012年7月23日 上午 07:33 not a discussion type post
所有回覆
-
2012年7月21日 上午 08:46
copy from Pinel Dave
http://blog.sqlauthority.com/2008/01/03/sql-server-2005-last-ran-query-recently-ran-query/
not very friendly to copy code from other people without mentioning the source.
besides that facts where is the context to SQL Server Security ?
- 已編輯 Daniel_Steiner 2012年7月21日 上午 08:47
-
2012年7月23日 上午 07:14
Hai Daniel_Steiner,
Yes i find this code from SQL Authority, But i need is Who Run the code last time for the particluar procedure ?

