Below is the SQL script share by one of my friend Ken Watson to find out the last executed queries.
SELECT usecounts, cacheobjtype, objtype, text
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
WHERE usecounts > 1
ORDER BY usecounts DESC;
About Ken
He is working as SQL DBA.
Blog:- interflextech.com/blog
Twitter:- @interflextech
Discover more from Technology with Vivek Johari
Subscribe to get the latest posts sent to your email.
Nice Article !
Really this will help to people of SQL Server Community.
I have also prepared small note on this, Script to find last executed query in SQL Server.
http://www.dbrnd.com/2015/11/sql-server-script-to-find-the-last-executed-query-using-spid/
… [Trackback]
[…] Read More Information here on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More on to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Here you can find 4829 additional Information to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More on to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] There you can find 37100 additional Information to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More Info here to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More Info here to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] There you can find 45365 additional Info on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Information on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More on on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More on to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More on on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More here on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More here to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] There you will find 99542 additional Information on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Here you can find 77258 additional Information on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Information on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More Information here on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Information on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More on to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Find More here on that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]
… [Trackback]
[…] Read More Information here to that Topic: techmixing.com/2015/01/sql-script-to-find-last-executed.html […]