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.
Author |
Topic |
sponguru_dba
Yak Posting Veteran
93 Posts |
Posted - 2008-12-20 : 03:05:39
|
Hi allI 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 SizeTotal size of row = Fixed Data size + Variable Data Size + Null Bit Map + Row HeaderEx: Calculating Row size Ename Varchar(50)EmpID intEDept char(10)TrnID Numeric(13,0)DOJ DatatimeADD nvarchar(100)Fixed Data size = (int) + char + Numeric + Datatime = 4 + 10 + 13 + 8 = 35 BytesVariable Data Size = 2+(number of variable * 2) + Max_varchar_size = 2+(2*2) + 100 =106Each row also have some overhead of Null bit maps.Null_bitmap = 2 + ((number of columns + 7) % 8) 2+((6+7)/%8) = 7Row Header = 4 (always it is 4)SNIVAS |
|
sponguru_dba
Yak Posting Veteran
93 Posts |
|
|
|
|