Returning the batch text of cached entries that are reused
Definition Description
A. Returning the batch text of cached entries that are reused The following example returns the SQL text of all cached entries that have been used more than once. SELECT DISTINCT usecounts, cacheobjtype, objtype, text FROM sys.dm_exec_cached_plans CROSS APPLY sys.dm_exec_sql_text(plan_handle) WHERE usecounts > 1 --AND text like '%FROM KFormIlanDB%' ORDER BY usecounts DESC GO