Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

All Db's infromation of instance Expand / Collapse
Author
Message
Posted Tuesday, November 13, 2012 9:47 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 9:24 AM
Points: 1,000, Visits: 2,979
Does any one know a simple query that would give following information about all databases on an insance?
1. Database Name
2. Created Date
3. Modified date (if any changes made to any table in a particular db)
4. Size of the DB Name.
5. Database last read (NOTE: i do weekly backups so wanted to make sure i am not pulling backup date instead of read date)
Post #1384171
Posted Wednesday, November 14, 2012 12:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, December 28, 2013 3:33 PM
Points: 5, Visits: 74
Hi, try the following query, hope it helps.

SELECT * FROM sys.databases



Regards,
Asa_M
Post #1384425
Posted Wednesday, November 14, 2012 5:11 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 10:34 AM
Points: 857, Visits: 370
For a starter in relation to DB_Name, Create date and size the following will work. This looks only at the 1st data file and ignores the log files but can be amended if you have multiple data files by adding the additional file to the in statements

SELECT sd.name, sd.create_date, (sm.size*8)/1024 AS SizeMB from sys.databases sd JOIN
sys.master_files sm on sd.database_id = sm.database_id where sm.file_id IN (1)

Post #1384550
Posted Wednesday, November 14, 2012 7:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, December 28, 2013 3:33 PM
Points: 5, Visits: 74
hs24, the SizeMB is the size for what exatly? the whole database?
Post #1384626
Posted Wednesday, November 14, 2012 8:48 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 10:34 AM
Points: 857, Visits: 370
The sizeMB is for the size of the data file
Post #1384691
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse