SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 system table for stored proc info
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kowalsky
Starting Member

USA
27 Posts

Posted - 08/25/2010 :  13:30:48  Show Profile  Reply with Quote
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

USA
5072 Posts

Posted - 08/25/2010 :  13:36:35  Show Profile  Visit russell's Homepage  Reply with Quote
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 - 08/25/2010 :  13:37:21  Show Profile  Reply with Quote
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

USA
27 Posts

Posted - 08/25/2010 :  13:46:32  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000