_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › GetPerformanceTipsDirectlyFromSQLServer

DECLARE @StringToSearchFor VARCHAR(255) 
SET @StringToSearchFor ='%<MissingIndexes>%'
--'%<MissingIndexes>%'
--'%<ColumnsWithNoStatistics>%'
--'%<TableScan%' 
--'%CREATE PROC%MessageWrite%'

SELECT TOP 20 
st.text AS [SQL] 
, cp.cacheobjtype 
, cp.objtype 
, DB_NAME(st.dbid)AS [DatabaseName] 
, cp.usecounts AS [Plan usage] 
, qp.query_plan 
FROM sys.dm_exec_cached_plans cp 
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st 
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp 
WHERE CAST(qp.query_plan AS NVARCHAR(MAX))LIKE @StringToSearchFor 
ORDER BY cp.usecounts DESC 
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

語 螳 覈 覈 朱覿 覦一 伎 螳 覦 覈 豺谿 伎 螳 螳 螳 譟一 譴 企. (覓企)