hi all, I have a database in sql server 2000 and i suspect that some tables are nor used anymore and i wanto to drop them. but before drop tables how can i check whether they are used or not? thanks in advance
You can create a trigger for that tables. This trigger could write in some table if table was used. After some time you check what table was not used.
i can track only dml changes by using triggers. How can i track select statements aginst this tables?
When you only use procedures to access the data, you could search syscomments (if I recall correctly) to find references to that tables. If you however also use embedded SQL in the client applications, or even allow to send dynamically created statements to the database, you could ask the client developer whether or not they reference these tables in their code (and trust them...) or as the hard way you rename the table and see if something breaks.
Ismail Do you have any storage free space issues on this instance? If not I wouldn't recommend the tables that you feel they are not used. As referred you can run a server side trace to find whether thes objects are accessed, there is no quick way to get this out but a brief planning is required to identify the tables.
thank for your replies, Firstly i will trace objects and i will change the name and i will test system whether any error appears or not after that i would bbe ensure that object not used and i will back up db and i will delete the object.
...just another step after the backup is to create & store a TSQL script for dropped tables. Just in case if you need to use means you can simply use the scrip to create and restore database as another name to import the data []