All Db's infromation of instance

  • 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)

  • Hi, try the following query, hope it helps.

    SELECT * FROM sys.databases

    Regards,

    Asa_M

  • 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)

  • hs24, the SizeMB is the size for what exatly? the whole database?

  • The sizeMB is for the size of the data file

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply