![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Sometimes at the end of a project you'll end up with unused Tables, Stored Procs, Functions, and Views. Since there is not something like a 'SELECT' trigger ... what is the best way for telling what is not being used by your solution? To turn on some kind of tracing? Any ideas? Thanks, Kelly Greer kellygreer1 (AT) nospam (DOT) com change nospam to yahoo |
#3
| |||
| |||
|
|
Copy -Paste from Tony articles In SQL 2005 there is, sort of. This is query lists the last execution time for all SQL modules in a database: SELECT object_name(m.object_id), MAX(qs.last_execution_time) FROM sys.sql_modules m LEFT JOIN (sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text (qs.sql_handle) st) ON m.object_id = st.objectid AND st.dbid = db_id() GROUP BY object_name(m.object_id) But there are tons of caveats. The starting point of this query is the dynamic management view dm_exec_query_stats, and the contents is per *query plan*. If a stored procedure contains several queries, there are more than one entry for the procedure in dm_exec_query_stats. |
#4
| |||
| |||
|
|
Sometimes at the end of a project you'll end up with unused Tables, Stored Procs, Functions, and Views. Since there is not something like a 'SELECT' trigger ... what is the best way for telling what is not being used by your solution? To turn on some kind of tracing? Any ideas? Thanks, Kelly Greer kellygre... (AT) nospam (DOT) com change nospam to yahoo |
#5
| |||
| |||
|
|
On Jan 21, 6:36 pm,kellygreer1<kellygre... (AT) yahoo (DOT) com> wrote: Sometimes at the end of a project you'll end up with unused Tables, Stored Procs, Functions, and Views. Since there is not something like a 'SELECT' trigger ... what is the best way for telling what is not being used by your solution? To turn on some kind of tracing? Any ideas? Thanks, Kelly Greer kellygre... (AT) nospam (DOT) com change nospam to yahoo have you checked out SQL Dependency Tracker? |
![]() |
| Thread Tools | |
| Display Modes | |
| |