I have three stored procedures. SPA calls SPB calls SPC.
I exec SPA, and it runs, calling SPB, calling SPC. Fine.
But the DMVs don't seem to have any plans - for SPA and SPB!
A few seconds later I run the SQL below, I get 29 rows, a number of rows for each SP, and it has query stats for SPA and SPB and SPC, but the query_plan column is null for SPA and SPB! There are plan generation numbers, but no plans. The plans are there for SBC.
Why would that be?
The systems are fairly quiet, so I can hardly see them getting flushed for memory.
SQL 2008 R2, Windows Server 2008 R2, 64bit, 8gb max on 12gb server.
Thanks.
Josh
SELECT db_name(qp.[dbid]) as dbname ,OBJECT_NAME(qp.objectid) as [Object] ,qp.* ,qs.plan_handle ,qs.plan_generation_num ,qs.total_worker_time FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp where OBJECT_NAME(qp.objectid) in ('SPA', SPB', 'SPC') order by 2,5;