Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char vs Varchar - Performance
Message
 
To
01/02/2005 11:13:57
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00982531
Message ID:
00982698
Views:
40
Bonnie;

"a NULL is almost always different than empty".

I was taught that you should use null for all data types to indicate that no data has been written. Giving it further thought it does not make sense to me to use null with char or varchar types when a space will indicate no data exists. Absolute statements as I learned in SQL Server classrooms (“Always use a null”! ) seem to not always be accurate. In the end it may be up to the designer to define such things.

Tom


>Sergey,
>
>It sounds like you and I don't agree on the use of NULLs. We use NULL for most columns, unless it's a PK or an FK that *must* be populated. IMHO, a NULL is almost always different than empty. Even for character data.
>
>~~Bonnie
>
>
>
>>>>Yes, in SQL 2000 fixed lenght data types always take the same space regardless what value is stored in it.<
>>>
>>>Another good reason to use varchars!!! <g>
>>
>>I'm not sure why would you want to use Null in the char/varchar field in the first place unless empty values is not the same as Null.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform