July 13, 2011 at 12:29 am
Morning Everybody,
I have a doubt regarding the memory allcation in Sql server tables designing..
Create table test
(
id int,
name varchar(10) --- doubt regarding the data type size
)
IN this above situation i declared name varchar(10) for this how the memory allocation in database.. is this is like bit wise or byte wise... Please give me clarification in this
Thanks in advance
Skase05
July 13, 2011 at 1:18 am
Memory-allocation is not as simple as it sounds. Storage per row is easier to explain.
A varchar takes 2 bytes + the number of bytes stored in it,
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2011 at 1:27 am
Thanks for ur reply...
If i am having the column in table with datatype varchar(10) means it will stores the the string with the max length of 10 characters.. If i am storing 'suresh' inside that variable remaining space will be released or it will be alloted as char type allocation...
Thnaks in advance..
suresh
July 13, 2011 at 1:40 am
GilaMonster (7/13/2011)
A varchar takes 2 bytes + the number of bytes stored in it,
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply