It often happens that DBA’s/Developers end up creating database objects(mostly tables) during development phase for various reasons like intermediate testing or backup. Such objects often end up on production databases.

DBA’s/Developers often repeat same things on production databases as well

Probable Reasons

  • Backup before performing quick fix
  • Performance optimization

It is always a good practice to delete such objects created for temporary purposes. However, most of the times DBA’s/Developers forget to drop them. 

Drawbacks

  • Unorganized database
  • Unnecessary space claim

How if there was a way to identify tables/indexes that are not used? Well, not to worry there is a way to find out tables and indexes that are not used.

Here is the script (using onf of the DMV’s) to find out the tables/indexes that are not used by any SQL process.

Such objects can be dropped after consulting with team members supporting the particular application.

P:S – The statistics are reset with SQL restart.

 

Regards

Ritesh Medhe

Like us on FaceBook Follow us on Twitter

Join the fastest growing SQL Server group on FaceBook