Created
March 3, 2015 16:57
-
-
Save veysby/9586722a06add9b9548a to your computer and use it in GitHub Desktop.
MSSQL: cached query plans
This file contains 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
-- DO NOT RUN this script on Production environment | |
-- Clear the plan cache | |
dbcc freeproccache | |
-- Look at the cached query plans | |
select st.text,* | |
from sys.dm_exec_cached_plans cp | |
cross apply sys.dm_exec_sql_text(cp.plan_handle) st | |
where (st.text like '%select * from Person.Address%') | |
and st.text not like '%select st.text%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment