Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

SQL Server 2000

I've been tasked with cleaning up an SQL database of which I have no history working with so I'm not familiar with the tables within. Short from dropping a table and seeing if anyone hollers, what is the best practice for cleaning up orphan tables? I did not see a "modified date" attribute on the table, only a "created date".

Would the process be the same for SQL Server 2005/8?

Thanks, Dave

share|improve this question

migrated from stackoverflow.com Oct 8 '11 at 16:33

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Couple of different approaches you could try with a Profiler trace.

  1. Capture SQL:StmtCompleted, with a column filter on TextData %TableName%.
  2. Capture Lock:Acquired event, with a filter on ObjectID with the id of the table.
share|improve this answer

With SQL Server 2008 you could use the integrated Tracking: Change Tracking Overview

With SQL Server 2000 you have to use triggers and log the data yourself. (Also mentioned in the MSDN Article)

(I prefer the "kill table and wait for problems" solution...)

share|improve this answer
1  
(I prefer the "kill table and wait for problems" solution...) - So I'm not alone here, huh? LOl –  dlackey Oct 5 '11 at 15:31
1  
Rename the table first of course. So you can instantly restore it and blame storage/network/client app/anyone else –  gbn Oct 11 '11 at 19:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.