MSDB and History of DB Sizes

  • In MSDB, table "BackupFile" contains a list of logical database names and their file sizes at the time they were backed up. I want to find the "date" of the backup associated with each record. If I could do that, then I'd have a daily history of database growth automatically collected in Msdb. But how can I find the "date" of the backup record?


    Bill Salkin

  • Hi!

    I modified a MS Stored prcoedure that tells you the database size of each db. I only modded it so it writes the information to a table. This SP is then run as a job every night. You can monitor DB growth with that. Let me know if you want the script...


  • Andy - Im sure other readers would be interested in looking at your proc if you wouldn't mind adding to our script library.

    Bill - interesting idea. Try dbo.backupfile in msdb. Only downside I can think (assuming the data is there!) would be if you or the maint plan is purging the history. On the other hand, not sure that just db sizes are enough, nice to be able to monitor table sizes too.


  • Thanks for all the great ideas. I came up with this script to display the 'D'atabase sizes.

    use msdb

    select backup_start_date, logical_name, ROUND(file_size/(1024*1024),0) from

    backupset join backupfile

    on (backupset.backup_set_id = backupfile.backup_set_id) and file_type = 'D'


  • Throw it in the script library Bill!


  • Nice one!

    Steve Jones

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

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