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
 SQL Server Administration (2000)
 find exact row size of a table

Author  Topic 

peddi_praveen
Starting Member

48 Posts

Posted - 2004-01-14 : 09:18:00
Hi guys,
Im in Process of Determining the row size of a given table and in the process, i was doing below..
use northwind
go
create table test5
(a varchar(8000),
b text,
c text,
d text
)
when i was creating table, SqL thown warning msg states that row size is 8077.
-- max row size : 8077
then i followed the guidelines in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_92k3.asp and tried to determine
-- ascertain by calculating
num_cols = 4
fixed_cols = 0
variable_cols = 4
fixed_data_size = 0
max_var_size = 8000+ (16*3) = 8048 -- did i went wrong in calculation of ascertaining max_var_size
null_bitmap = =0 --as there are no fixed length columns (as per URL)
variable_data_size = 2 + (Num_Variable_Cols x 2) + Max_Var_Size
= 2+ (4 * 2) + 8048
= 8058
Total row size (Row_Size) = Fixed_Data_Size + Variable_Data_Size + Null_Bitmap +4
= 0 + 8058 + 4
= 8062

difference is 15 bytes.
can any body explain why this diff take place?
few more related questions:
1.
what is the behaviour of text field in determining rowsize. as we know , data for text fields is out of the data pages, and how will it b part of rowsize? (look at the table definition in the example, ). if the data for text fields is residing out of data pages, why Sql server is taking count of storage occupied by text fields in determining row size?

2.is there any free third party tool which will determine the exact max rowsize of a table. any links? any other short cuts to ascetrtain the row size?

thanks in advance,
Praveen

X002548
Not Just a Number

15586 Posts

Posted - 2004-01-14 : 11:12:49
Can you tell us why you need to use more than 1 text column?

Or any at all?



Brett

8-)
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-01-14 : 11:54:27
Have a look at the page structure
http://www.nigelrivett.net/PageStructure.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

peddi_praveen
Starting Member

48 Posts

Posted - 2004-01-14 : 22:40:02
Hi Brett,
The table in the context is a dummy table, i was trying how sql server determining the rowsize.
are there any concerns if we have more than one text field?


thanks in adv,
praveen
Go to Top of Page
   

- Advertisement -