I know how to get the latest executed queries using the following SQL in SSMS -
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
But I want to find them for a specific database. I do not want to use SQL Profiler if I do not need it. Plus, I donโt think that SQL Profiler will allow me to view queries that have already been executed without enabling profiling. I need to do this from SSMS.
sql-server sql-server-2012
Mukus Nov 30 2018-12-12T00: 00Z
source share