nilay.chaudhary (10/16/2013)
I think this is only related to older SQL versions
No, it's true for all versions of SQL from 2005+
You can do a check for the SP calls with this code for example:
SELECT cp.objtype AS PlanType,
OBJECT_NAME(st.objectid,st.dbid) AS ObjectName,
cp.refcounts AS ReferenceCounts,
cp.usecounts AS UseCounts,
st.TEXT AS SQLBatch,
qp.query_plan AS QueryPlan
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) AS st
where OBJECT_NAME(st.objectid,st.dbid) = 'GetIt'
Actually this is one of the main points of QofD, to try find something that is true/false for another version or a specific case and etc,... 🙂
Regards,
IgorMi
Igor Micev,My blog: www.igormicev.com