How to find the recent queries which we executed

Posted by Amatya under Sql Server on 8/19/2015 | Points: 10 | Views : 293 | Status : [Member] | Replies : 1
How to retrieve the SQL queries which i have executed recently

Feel free to share informations 9731764134
mail Id ' adityagupta200@gmail.com
Thanks



Responses

Posted by: Rajesh123 on: 8/19/2015 [Member] Starter | Points: 25

Up
0
Down
SELECT
a.last_execution_time AS ExectuionTime,
b.text AS Query
FROM sys.dm_exec_query_stats a
CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) b
ORDER BY a.last_execution_time DESC


http://www.sqlservercentral.com/blogs/bradleyschacht/2011/11/03/find-recently-run-queries/
http://dba.stackexchange.com/questions/35703/find-all-the-queries-executed-recently-on-a-database

rajesh.plsql123@gmail.com

Amatya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response