Created
March 19, 2013 16:13
-
-
Save rodolfofadino/5197478 to your computer and use it in GitHub Desktop.
query execution count
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
--DBCC TRACEON(8666) | |
--GO | |
SELECT qt.text [Comando], | |
CP.usecounts [Qtd Executado], | |
cp.size_in_bytes [TamanhoBytes], | |
cp.objtype [TipoConsulta], | |
qp.query_plan [ExecutionPlan] | |
FROM sys.dm_exec_cached_plans cp | |
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp | |
CROSS APPLY sys.dm_exec_sql_text (cp.plan_handle) qt | |
WHERE qt.text LIKE '%termo%' and qt.text not LIKE '%sys.dm_exec_cached_plans%' | |
--dbcc freeproccache | |
--DBCC TRACEOFF(8666) | |
--GO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment