Here is a script to find out database’s file (either Data file-MDF or Log File – LDF ) growth details. To find this we can use MSDB’s two tables, one is backupfile table which Contains one row for each data or log file of a database and secondone is backupset table which Contains a row for each backup set.

Script is as below.

SELECT BS.database_name
BF.file_size/(1024*1024) FileSize_MB
msdb.dbo.backupfile BF
JOIN msdb.dbo.backupset BS ON BS.backup_set_id = BF.backup_set_id
BS.database_name‘VirendraTest’ — Database Name
logical_name VirendraTest’    — DB’s Logical Name
BY BS.backup_finish_date DESC

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s