How to get size of BAK backup files

  • Am using SQL Server 2000 Enterprise. I know a variety of ways to get the MDF and LDF file sizes using sp_helpfile and such. I can't seem to figure out how to get the BAK file sizes without going directly to the server drives.

  • I don't have access to SQL Server at the moment to verify this, but you can can probably get what you are after from the backup_size column in the backupset table in the msdb database.

  • That is correct.

    You may also run this script, which gives you more related info:

    ---------------------------------------------------------------------------------

    --Database Backups for all databases For Previous Week

    ---------------------------------------------------------------------------------

    SELECT

    CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,

    msdb.dbo.backupset.database_name,

    msdb.dbo.backupset.backup_start_date,

    msdb.dbo.backupset.backup_finish_date,

    msdb.dbo.backupset.expiration_date,

    CASE msdb..backupset.type

    WHEN 'D' THEN 'Database'

    WHEN 'L' THEN 'Log'

    END AS backup_type,

    msdb.dbo.backupset.backup_size,

    msdb.dbo.backupmediafamily.logical_device_name,

    msdb.dbo.backupmediafamily.physical_device_name,

    msdb.dbo.backupset.name AS backupset_name,

    msdb.dbo.backupset.description

    FROM msdb.dbo.backupmediafamily

    INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id

    WHERE (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) >= GETDATE() - 7)

    ORDER BY

    msdb.dbo.backupset.database_name,

    msdb.dbo.backupset.backup_finish_date

  • thanks for this tip...

    we've been waiting for a solution on this one...

    thank you so much....

    Business Bankruptcy

  • That is perfect. Thanx.

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

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