Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)


By Abhijit Shedulkar,

Basically it's a DBA’s responsibility to maintain the database server cleanup. Most probably a developer or some application owner will ask to restore the UAT database on the production server for some reason, forgotting to drop the same. When the audit starts our auditor asks why the unwanted database or objects are present on production server. In that case it is very difficult to determine which database is used or not from potentially hundreds of databases.

To resolve such type of issue I have implemented following stored procedure which, provides the object wise last used date of all databases which are available in single instance.

How to Use:

  1. Create a “Database_Object_Last_used_details” store procedure on your master database
  2. And execute the same whenever you want to fetch details

I would like to request, If you have any more idea to improve the above alert notification script please suggest them in the comments.

Thank & Regards,

Abhijit Y Shedulkar

(MSSQL Team Lead -CIPL)

Total article views: 1291 | Views in the last 30 days: 3
Related Articles

Count of Objects by Database on a Server

I needed to get a count of objects by database on a server to assess which dbs are good candidates f...


Answer - Objective Question (In which database temporary tables are created in SQL Server)

Question :- In which database temporary tables are created in SQL Server? 1) User database (where...


Database Object Permissions Lost

Database Object Permissions Lost


Database objects deployment

Database objects deployment


Read OLE Object Data from MS-Access which is imported from SQL Server

Read OLE Object Data from MS-Access which is imported from SQL Server


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones