SQL Server 2005 Scripts (creation of new databases)

algotube
algotube used Ask the Experts™
on
Hello experts;

      I have just taken over the SQL Server DBA position. I have noticed that some new databases have been created when 3rd party applications have been installed without me even knowing about it (this will be changing pretty fast)

I have seen this scenario come up a couple of times now and would like to know if there is a script I can use and run to view new created databases on SQL Server 2005.  I know I can use management studio and connec to the instance and go through the databases but  I rather just use a script.  

Thank you and have a great weekend

 
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This will tell you the names of all databases that were created in the last week.  For a different time period, just change the -7 to however many days that you want to go back.

Greg



SELECT d.[name], d.create_date
FROM sys.databases AS d
WHERE d.create_date > DATEADD(dd, -7, GETDATE())

Open in new window

Author

Commented:

Thank you so much for getting back to me.  Have a great day

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial