Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char vs Varchar - Performance
Message
From
01/02/2005 11:03:11
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00982531
Message ID:
00982674
Views:
24
Sergey,

>Prior to SQL 7.0 char column with Null value wouldn't take any space at all. Imagine some people surprise when there DB size went over the roof after converting to SQL 7. :)<

So, the same applies to SQL 2000? NULLs take up the whole space reserved for the datatype?

~~Bonnie



>Bonnie
><snip>
>
>>I wonder if what he says about storing NULL in a char(255) column is true? He says that it will take up the entire 255 characters ... I'm wondering how a NULL can take up 255 characters? I think he's wrong about that, but I don't know for sure how SQL stores such things. Maybe Sergey knows ...
>
>Prior to SQL 7.0 char column with Null value wouldn't take any space at all. Imagine some people surprise when there DB size went over the roof after converting to SQL 7. :)
>
>>I agree with what you say about when to use varchar instead of char. I do the same thing. My only question was if there were any performance issues, and it sounds to me, from Sergey's reply, that performance issues are probably negligible, which is the assumption I've been operating on all along.
>
>I would say that you're correct in your assumption.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform