HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

How to know DB size using backup file without restoring it

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
withoutfileknowsizerestoringusinghowbackup

Problem

Is there anyway so that we can estimated/know size of database using backup file without restoring it?

Solution

Yes, there is, though you got to use RESTORE command anyway. Instead of RESTORE DATABASE, use RESTORE FILELISTONLY to get a detailed view of files in the backup. The Size column tells the file size in bytes.

RESTORE FILELISTONLY FROM DISK = N'v:\MyBackup.bak'

Code Snippets

RESTORE FILELISTONLY FROM DISK = N'v:\MyBackup.bak'

Context

StackExchange Database Administrators Q#62527, answer score: 12

Revisions (0)

No revisions yet.