MaxBeauchemin
12/10/2018 - 7:18 PM

SSMS Query History

Accidentally closed the wrong SSMS tab?

Try this script to find your query

SELECT t.[text]
FROM sys.dm_exec_cached_plans AS p
CROSS APPLY sys.dm_exec_sql_text(p.plan_handle) AS t
WHERE t.[text] LIKE N'%something unique about your query%';