Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 system table for stored proc info

Author  Topic 

kowalsky
Starting Member

29 Posts

Posted - 2010-08-25 : 13:30:48
hi all,
I have a simple question: what system table should I query to find out when was the last time a stored proc has ran.

Thank you very much,
kowalsky

kowalsky

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-08-25 : 13:36:35
you can't. no such field. but this will tell you f it's been called since last restart
select	query_plan
from sys.dm_exec_cached_plans cp
cross apply
sys.dm_exec_query_plan(cp.plan_handle) xp
where convert(varchar(max), query_plan) like '% search object here %'
and objtype = 'Proc'
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-25 : 13:37:21
The answer is None

I log all of my sproc executions.."manually"



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

kowalsky
Starting Member

29 Posts

Posted - 2010-08-25 : 13:46:32
russell,
thanks a bunch - I was looking for the easy way out ... obviously, between restarts I can run that proc many, many times.

X002548,
I will do the same,

Thanks again,
kowalsky

kowalsky
Go to Top of Page
   

- Advertisement -