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 |
Lopaka
Starting Member
48 Posts |
Posted - 2007-06-07 : 13:22:55
|
I am designing a new Database and in setting up the tables the following questions came to me:1. Char VS Varchar: When exactly would you use Char if Char uses a fixed length and Varchar is variable length. Since most of the time you would NOT fill a character string you would use less bytes over time?2. Character Strings VS Unicode Character Strings: Again, when would you use unicode over character?Thank youRobert R. Barnes |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-06-07 : 13:26:31
|
1. If your data almost always will fill the column, then use char. One example of a char column would be the state abbreviations.2. If you need to store unicode data, then you need to use unicode data types. This is done when you need to support languages that use unicode data type.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
Lopaka
Starting Member
48 Posts |
Posted - 2007-06-07 : 13:36:14
|
I understand response 1, but 2? If Unicode then I am able to store French, Italian, Spanish, etc... Unicode supports the special charactors and the other does not?Robert R. Barnes |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-06-07 : 14:03:31
|
Please check SQL Server Books Online for details on unicode data.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
TonyTheDBA
Posting Yak Master
121 Posts |
Posted - 2007-06-08 : 08:59:10
|
quote: Originally posted by Lopaka I understand response 1, but 2? If Unicode then I am able to store French, Italian, Spanish, etc... Unicode supports the special charactors and the other does not?
Not so much Spanish, French etc as the characters for these are included pretty much in the extended Ascii Set And code pages., its when you need to store Korean, Arabic, Japanese characters when the Double byte Characterset is used . . . Hence using unicode . . . . Using unicode data types occupies twice the space the standard type would use. This is an argument I have with one of my developers on numerous occasions, usually accompanied by the comment "Have you had an extra bowl of stupid this morning" :)-- RegardsTony The DBA |
 |
|
|
|
|
|
|