The information for backup size is stored in the backup_size column of the backupset table in the msdb database as the total bytes for that backup.
This script allow you to look at the total back to tape or file so you can plan space needs for those devices.
This is a simple piece of code so you may need to adjust for your specific needs, but the basic outline of it should help you in looking at your backups in whatever situation you need.
Also files have a header and maybe footer so there are some extra bytes added beyond what is stored in the database for this information which is 1536 and has been calculated in.
Some Options you should be aware of when using this code.
backupmediafamily device_type
2 = File
5 = Tape
backupset type
L = Log
I = Differential
D = Full
(Note: May be other options but these are the ones I find on my system and can identify.)
T-SQL to Export Table Structure to a script
When you want to export a table structure to T-SQL, everyone always points you to Enterprise Manager, or a script that calls BCP.Sometimes, a developer either doesn't have access to those tools, or just doesn't want to use them (like me) out of spite.I made this T-SQL because it was educational, and noone else seems […]
2003-03-26
4,003 reads