Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need a query that can show the last time a table w

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2009-07-15 : 12:08:51
Hello All,

I have a task to delete or move all the obsolete tables in our database environment. I have search the net but with no success, for a script I can run against a database that can show me the last time a particular table was accessed. Does any know how to write a query that can accomplish this task? Please advice. Thanks.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-15 : 13:07:15
no such query exists. you can use Sys.dm_db_index_usage_stats to get an idea of whether or not a table is used.

may also want to look at sp_trace_create
Go to Top of Page
   

- Advertisement -