Create a new view called ExecutionInfo with execution count, average/max execution time and total execution time for all executions of inspector stored procs logged to the Executionlog table.
CREATE VIEW [Inspector].[ExecutionInfo]
AS
SELECT
Procname,
COUNT(Procname) AS ExecutionCount,
SUM(Duration) AS TotalDuration_Seconds,
AVG(Duration) AS AverageDuration_Seconds,
MAX(Duration) AS MaxDuration_Seconds
FROM Inspector.ExecutionLog
WHERE Procname != N'InspectorDataCollection'
GROUP BY Procname;
Create a new view called ExecutionInfo with execution count, average/max execution time and total execution time for all executions of inspector stored procs logged to the Executionlog table.
CREATE VIEW [Inspector].[ExecutionInfo] AS SELECT Procname, COUNT(Procname) AS ExecutionCount, SUM(Duration) AS TotalDuration_Seconds, AVG(Duration) AS AverageDuration_Seconds, MAX(Duration) AS MaxDuration_Seconds FROM Inspector.ExecutionLog WHERE Procname != N'InspectorDataCollection' GROUP BY Procname;