March 23, 2009 at 7:45 am
Hello
Do you have any idea how to determine which tables are not used?
Thanks
March 23, 2009 at 7:47 am
Run a trace on the database. Have it record which tables are accessed. From that, you can compare it to sys.tables, and find which ones aren't.
Just be sure to run it for a good, long time, because you don't want to drop a table that's critical for monthly or quarterly reports, just because it wasn't used this afternoon.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 23, 2009 at 7:49 am
Thanks, but is the only way to do this?
March 23, 2009 at 7:50 am
the way described above is the only way.
SQL Server does not keep track of when a table was accessed, only a trace can be used to determine that.
Lowell
March 23, 2009 at 7:58 am
Ok
SQLServer has information for index that are not used.
And for stored procedures, views or other objects?
March 23, 2009 at 8:00 am
Same deal. Run a trace. It'll tell you exactly what's being used.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 23, 2009 at 8:10 am
Oscar Fernandez (3/23/2009)
SQLServer has information for index that are not used.
That info's only since the last start of the SQL service. The data in the index usage DMV is not persisted across restarts.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 23, 2009 at 9:46 am
Perfect.
Thanks
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply