|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 8:15 AM
Points: 1,251,
Visits: 1,840
|
|
Hello,
Before I run backup,can I check how big it will be?
Thank you
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Today @ 1:45 PM
Points: 15,442,
Visits: 9,572
|
|
Not really. You can get a general idea, in that it's usually smaller than the database (assuming free space in the data and log files).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 9:38 AM
Points: 237,
Visits: 1,195
|
|
This will tell you the minimum size (the size of your MDF and NDF files). The backup, unless compressed, will never be less than this.
USE {myDB};
SELECT SUM(size/128) AS mb FROM sys.database_files WHERE type = 0
-- AJB xmlsqlninja.com
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 3:37 PM
Points: 38,028,
Visits: 30,334
|
|
Actually it probably will be.
That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of it. So if you have a 10GB database that's only 50% allocated, the backup will (ignoring contribution from the log) be around 5GB in size.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 9:38 AM
Points: 237,
Visits: 1,195
|
|
GilaMonster (8/20/2012) Actually it probably will be.
That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of it. So....
Good catch. Did not think about unused space.
-- AJB xmlsqlninja.com
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 10:44 PM
Points: 320,
Visits: 527
|
|
Use dbname Go Select count(Total_pages), count(used_pages) , sum( total_pages* 8) TotalPagesKb, sum(used_pages * 8 ) Usedpageskb from sys.allocation_units
I am not sure above query will help you 100%, but you may get an idea about of your backup size will be.
|
|
|
|