Created
September 24, 2014 15:16
-
-
Save jdaigle/2fbfb232475f31b6f393 to your computer and use it in GitHub Desktop.
Evict SQL Query Plan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT [text], cp.size_in_bytes, plan_handle | |
FROM sys.dm_exec_cached_plans AS cp | |
CROSS APPLY sys.dm_exec_sql_text(plan_handle) | |
WHERE cp.cacheobjtype = N'Compiled Plan' | |
AND cp.objtype = N'Adhoc' | |
AND cp.usecounts = 1 | |
ORDER BY cp.size_in_bytes DESC; | |
DBCC FREEPROCCACHE(plan_handle) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment