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)
 How to Calculate the Row Size

Author  Topic 

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-05-11 : 03:21:33
If a table has two columns and two rows, columns are
ID int,
T1 float
and both the rows contain NULL values

what would be the size of each row?

Will row size would be the addition of its column's data type even if there is NULL, or row size will be calculated only if there is data in columns?


Beachsandintoes
Starting Member

15 Posts

Posted - 2005-05-11 : 17:59:13
Hi,

Int and float are fixed length data types which means space is allocated even if the columns are null.

FYI: An Int(eger) is 4 bytes, a float is 4 bytes, and a double float is 8 bytes.

If you are trying to calculate how many records will fit in a page then you should also know that:
- SQL server doesn't split a record across pages (Note: I believe this is true but you should confirm)
- Additional space is allocated per row for a row header and to track null columns
- Additional space is allocated for page header info that maintains information about the page

I hope this helps.

- Beach
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-05-11 : 18:22:52
Duplicate post:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49584

Tara
Go to Top of Page
   

- Advertisement -