Laboratory/MSSQL

Plan 캐쉬에 저장 된 쿼리 확인

theking 2014. 6. 12. 18:36

   

 

SELECT usecounts, cacheobjtype, objtype, [text], t.objectid

FROM sys.dm_exec_cached_plans P

    CROSS APPLY sys.dm_exec_sql_text (plan_handle) T

WHERE cacheobjtype = 'Compiled Plan'

    AND [text] NOT LIKE '%dm_exec_cached_plans%'

    AND objtype='Proc' and [text] like '%upInsertComparatorResult%'