nire0510
7/30/2015 - 8:11 AM

Search query in MSSQL queries history

Search query in MSSQL queries history

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'%PART_OF_YOUR_QUERY%';