当前位置:网站首页>Script to view the execution of SQLSERVER database stored procedures

Script to view the execution of SQLSERVER database stored procedures

2022-06-23 17:46:00 mb60b79a6396b63


       
SELECT TOP 100 db_name(d.database_id) as DBName,
s.name as Store name ,
s.type_desc as Storage type ,
d.cached_time as SP Time added to cache ,
d.last_execution_time as The last time to perform SP Time for ,
d.last_elapsed_time as [ The last time to perform SP Time spent ( subtle )],
d.total_elapsed_time as [ Complete this SP The total time taken to execute ( subtle )],
d.total_elapsed_time/d.execution_count as [ Average execution time ( subtle )],
d.execution_count as Number of executions since the last compilation
FROM SYS.procedures S JOIN SYS.dm_exec_procedure_stats D
ON S.object_id=D.object_id
WHERE S.NAME='SP_Name'
ORDER BY D.total_elapsed_time/D.execution_count DESC
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.


原网站

版权声明
本文为[mb60b79a6396b63]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211717381728.html