I know that how many times it was executed from execution_count in sys.dm_exec_procedure_stats.But how these values are Calculated? Is there any way to know how these values get calculated? I want whole log when the stored procedure was first time executed to till last_execution_time logs.
Sql-server – How to get the whole execution log of stored procedure
sql-server-2008sql-server-2008-r2
Related Question
- Sql-server – How to reliably track stored procedure ( and functions ) use over time
- Sql-server – Move values from one table to another one via stored procedure in sql server 2008
- SQL Server – How to Get Return Value from Stored Procedure Executed with sp_executesql
- SQL Server Audit – How to Tell if a Stored Procedure Has Executed Against a Particular Database
- SQL Server 2008 R2 – Passing Comma Separated Values to Stored Procedure Parameters
- Empty Last Execution Time of Stored Procedure – What It Means
- SQL Server – How to Get Database Name in Stored Procedure
Best Answer
Answer to this can be refer from MSDN stating below
You can run something like below code to collect the data from this dmv as per the load to analyse the usage of resources during the execution of that SP:
You can modify the query above and gather the data to collect the metrics for the SP by scheduling it via SQL agent job. After a certain interval you will have sufficient data to make analysis. An example of such is illustrated here.
Hope this helps!