Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Varchar vs. char
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00690420
Message ID:
00690517
Vues:
14
>>While I agree with you, the overhead is not enough to worry about IMO. Unless the data is fixed length, I always use nvarchar for strings.
>
>I am pulling from BOL:
>
>Use char when the data values in a column are expected to be consistently close to the same size.
>
>Use varchar when the data values in a column are expected to vary considerably in size.
>
>If is your experience that there is not much of a performance difference?

varchar and nvarchar will only use as much space as necessary. Usually we allocate space for the theorical max., such as title's being 128 characters. Most aren't. By not using the extra space, you get more rows on the page which leads to SQL Server doing less work.

>> Also, why nvarchar? Is Unicode that popular, or due to the fact the SET ANSI_PADDING is always ON?

it has been my experience that customer always want to come back and "internationalize" their applications. so we've just started using the unicode datatypes as a standard practice.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform