Skip to content

Instantly share code, notes, and snippets.

@heluvaguy
Last active August 9, 2016 09:49
Show Gist options
  • Save heluvaguy/dbca1e45a5add2275426b8ae17f7ece0 to your computer and use it in GitHub Desktop.
Save heluvaguy/dbca1e45a5add2275426b8ae17f7ece0 to your computer and use it in GitHub Desktop.
query history from TSQL
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%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment