SELECT d.plan_handle ,
d.sql_handle ,
e.text
FROM sys.dm_exec_query_stats d
CROSS APPLY sys.dm_exec_sql_text(d.plan_handle) AS e
WHERE text like '%2021-05-31%'
Source : https://dba.stackexchange.com/questions/4043/can-i-see-historical-queries-run-on-a-sql-server-database
No comments:
Post a Comment