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)
 Moving Part of data from One server to other

Author  Topic 

sponguru_dba
Yak Posting Veteran

93 Posts

Posted - 2008-12-20 : 03:05:39
Hi all

I got this formula from one of friend.
I want to know whether it is correct or not and if data types Varchar (max) or nvarchar (max) how to calculate row size.

If I want move data shall I consider Index also?
, If Indexes are considered how to calculate Index size.



--Calculation Data Size

Total size of row = Fixed Data size + Variable Data Size + Null Bit Map + Row Header

Ex: Calculating Row size

Ename Varchar(50)
EmpID int
EDept char(10)
TrnID Numeric(13,0)
DOJ Datatime
ADD nvarchar(100)


Fixed Data size = (int) + char + Numeric + Datatime
= 4 + 10 + 13 + 8 = 35 Bytes

Variable Data Size = 2+(number of variable * 2) + Max_varchar_size
= 2+(2*2) + 100 =106

Each row also have some overhead of Null bit maps.

Null_bitmap = 2 + ((number of columns + 7) % 8)

2+((6+7)/%8) = 7
Row Header = 4 (always it is 4)



SNIVAS

sponguru_dba
Yak Posting Veteran

93 Posts

Posted - 2008-12-20 : 03:41:43
Oh I got some information which was helpful

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

SNIVAS
Go to Top of Page
   

- Advertisement -