Plan Reuse abfragen

DECLARE @string varchar(500)
SELECT
@string = '%SomeString%'
SELECT
SCP.usecounts, SCP.cacheobjtype, SCP.objtype,
[Statement].text,
Executionplan.query_plan
FROM
sys.dm_exec_cached_plans SCP
OUTER APPLY sys.dm_exec_sql_text(plan_handle) [Statement]
OUTER APPLY sys.dm_exec_query_plan(plan_handle) Executionplan
WHERE
Statement.[text] LIKE @string AND
SCP.cacheobjtype ='Compiled Plan' AND
SCP.objtype = 'proc'
Noch kein Feedback
Einen Kommentar hinterlassen

Ihre E-Mail-Adresse wird nicht auf dieser Seite angezeigt.
SchlechtExzellent
(Zeilenumbrüche werden zu <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)
Trackback-Adresse für diesen Eintrag

http://www.insidesql.org/blogs/htsrv/trackback.php?tb_id=947