I am trying to figure out if there\'s a way to identify a \"version\" of a SP that gets called the most. I have an SP that gets called with a bunch of different parameters. I kn
I like this snippet of code for pulling back and reviewing the execution stats. and the cached query plan for a given stored procedure. In Management Studio, you can click on the XML returned in the "query_plan" column to view the graphical version of the execution plan.
SELECT qp.*,qs.*,st.text
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(sql_handle) st
CROSS APPLY sys.dm_exec_query_plan(plan_handle) qp
WHERE st.objectid= object_id('YourStoredProcedureName')