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 2000 Forums
 Transact-SQL (2000)
 Physical Size of a table

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2005-12-02 : 11:48:47
Guys,

Is there any way to calculate the physical size of the table on the database assuming that it is not on a seperate filegroup

any suggestions/input would help

Thanks

paulrandal
Yak with Vast SQL Skills

899 Posts

Posted - 2005-12-02 : 12:24:06
Look in the SS2005 BOL - I completely rewrote the topics on estimating table and index size. Look for 'estimating database size' in the index and you'll find drill-downs into heaps, clustered indexes and non-clustered indexes. They also apply to SS2000 (just leave out the parts that take account of new SS2005 features).

If you don't have SS2005 let me know and I'll post these topics here.

Thanks



Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
(Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2005-12-02 : 16:45:07
Paul, presumably, you mean this page:

http://msdn2.microsoft.com/en-us/library/ms187445.aspx

Of course, the complete SQL Server 2005 Books Online can be downloaded without SQL Server 2005 from here (116394 KB):

http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-12-02 : 16:47:29
Wouldn't sp_spaceused do the calculation for you? I didn't think he was talking about estimating it, but rather what is it right now.

Tara Kizer
aka tduggan
Go to Top of Page

paulrandal
Yak with Vast SQL Skills

899 Posts

Posted - 2005-12-02 : 17:18:47
quote:
Originally posted by Arnold Fribble

Paul, presumably, you mean this page:

http://msdn2.microsoft.com/en-us/library/ms187445.aspx

Of course, the complete SQL Server 2005 Books Online can be downloaded without SQL Server 2005 from here (116394 KB):

http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx



Yup - forgot that they'd been updated on MSDN already.

Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
(Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)
Go to Top of Page

mschroeter
Starting Member

1 Post

Posted - 2005-12-08 : 15:44:56
I'm currently going through a sizing exercise, and I've run into a problem using these formulas for calculating table/index sizes (they essentially remain unchanged since SQL2000 from what I can tell).

I'm ending up with a difference of 12 bytes per row using the formula versus what the xmaxlen column in sysindexes tells me. The formula always comes up 12 bytes short. Now, Kalen Delaney in Inside SQL 2000 says that there are 10 bytes of overhead per row, which the formula from what I can tell does not account for. It also leaves me still 2 bytes short per row.

So can anyone clear this matter up and offer something that's consistent with what the database actually says? I still don't know for sure how to get from A to B to calculate on paper what a table size should be and have it be accurate.
Go to Top of Page
   

- Advertisement -