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.
| Author |
Topic |
|
Sean_B
Posting Yak Master
111 Posts |
Posted - 2010-02-12 : 06:46:26
|
| Hi,is there anyway of telling when a stored procedure ws last executed, my understanding is that you can only tell this if you are collecting trace information.Sean |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-12 : 07:38:35
|
| Another method (taken from BOL)SELECT TOP 5 creation_time, last_execution_time, total_clr_time,total_clr_time/execution_count AS [Avg CLR Time], last_clr_time,execution_count, (SELECT SUBSTRING(text, statement_start_offset/2,(CASE WHEN statement_end_offset = -1 THEN LEN(CONVERT(nvarchar(max),text)) * 2 ELSE statement_end_offset END - statement_start_offset)/2)FROM sys.dm_exec_sql_text(sql_handle)) AS query_textFROM sys.dm_exec_query_stats ORDER BY [Avg CLR Time] DESC;GOMadhivananFailing to plan is Planning to fail |
 |
|
|
Sean_B
Posting Yak Master
111 Posts |
Posted - 2010-02-12 : 08:38:03
|
| Thanks Madhivanan, much appreciated.Sean |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-12 : 08:41:05
|
quote: Originally posted by Sean_B Thanks Madhivanan, much appreciated.Sean
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|