Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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)

Database_Object_Last_used_details

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: 1311 | Views in the last 30 days: 1
 
Related Articles
SCRIPT

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...

BLOG

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...

FORUM

Database Object Permissions Lost

Database Object Permissions Lost

FORUM

Database objects deployment

Database objects deployment

FORUM

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

Tags
 
Contribute