Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Variation in .mdf and .bak file sizes

Author  Topic 

learntsql

524 Posts

Posted - 2009-11-19 : 07:52:25
Hi...
There is a huge variation showing between .mdf file and .bak file of same database.
Why it is showing like this?
And How to know size of each table in a database.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-19 : 08:04:51
1 .bak includes Log file's contents too
2 exec sp_spaceused 'table name'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

learntsql

524 Posts

Posted - 2009-11-19 : 08:11:51
Sorry I didnt mention clearly in my post.
My .mdf file is showing 5 GB(approx.) and .bak is showing 600 MB.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-19 : 08:53:22
database files have reserved "unused" space and there is no need to put it into a bak-file.
see also sp_spaceused like madhi has posted.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-11-19 : 09:38:20
You can use these scripts to see the table sizes and to see how much space is used in the database files.

Script to analyze table space usage
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

Get Server Database File Information
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89058

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -