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 |
Manothinakaran
Starting Member
8 Posts |
Posted - 2010-06-28 : 02:39:31
|
Hi Gurus,what is the size difference in memory between a integer and a varchar(50)?Thank you very much |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-06-28 : 03:31:49
|
What do you mean by "in memory"? An int column uses 4 bytes of space while a varchar uses 2 bytes + the number of characters in the column. So a varchar(50) with "Lumbago" in one of the rows will take 2 + 7 = 9 bytes total.- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
Manothinakaran
Starting Member
8 Posts |
Posted - 2010-06-28 : 04:16:34
|
quote: Originally posted by Lumbago What do you mean by "in memory"? An int column uses 4 bytes of space while a varchar uses 2 bytes + the number of characters in the column. So a varchar(50) with "Lumbago" in one of the rows will take 2 + 7 = 9 bytes total.- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com
Hi Lumbago,U answered exactly what i wanted. Im sooo thankful to you.. U have a great day ahead.. |
 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-06-28 : 05:02:07
|
Excellent! A great day is just what I need - LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
|
|
|