question

Leo avatar image
Leo asked

Queries for Last 3 Months

Hi, Is that anyway can we find out in SQL Server 2008 which Stored Procedure are used or has been called from application for last 3 months? Basically I want to remove unused Stored procedure from Database. Thanks
sql-server-2008sql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Shawn_Melton avatar image
Shawn_Melton answered
That I know of, not unless you are capturing that information in a server-side trace or SQL Server Audit.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TimothyAWiseman avatar image
TimothyAWiseman answered
As Shawn points out, there is no way to do this retroactively, but you can set up systems like a Server Side Trace to log it going forward. Any such logging system is going to add some overhead though, especially if you leave it wide open instead of carefully limted. Combing through the transaction logs if you are in full recovery mode would give you vast amounts of information, but even with 3rd party tools to help, they are not exactly a user friendly way to get the answers you are looking for. Some more limited information about what has happened in the past can be gleaned from some of the system views and DMVs like `sys.dm_db_index_usage_stats`. The `sys.dm_exec_procedure_stats` is probably closest to what you are looking for, but not exactly.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.