|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Selecting between varchar and nvarcharWhen we design a string field, we can use varchar and nvarchar.
There are some field which will have Chinese word. I will use varchar if the field is just English character or digital. and use nvarchar if the field may contain Chinese word. Somebody recommend that it is better to use nvarchar for all string field for reason of purity. What is the best policy for selecting between varchar and nvarchar If you must use or allow for Unicode or double-byte characters, such as,
Chinese you have to use nvarchar. Using varchar involves 8-bit characters. If your applications will only use 8-bit characters varchar is fine. Show quote "ad" wrote: > When we design a string field, we can use varchar and nvarchar. > There are some field which will have Chinese word. > I will use varchar if the field is just English character or digital. > and use nvarchar if the field may contain Chinese word. > > Somebody recommend that it is better to use nvarchar for all string field > for reason of purity. > > What is the best policy for selecting between varchar and nvarchar > > > Thanks,
There are some fields in my database of pure of English character. and some fileds may have Chinese in it. Which one is better. 1. Using Unicode for every string field. 2. Using char/varchr for field of pure English character, using nchar/nvarchr for fields which may have Chinese character? "Eagle***@HighFlyingBirds.com" <EagleRedHighFlyingBirds***@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:E6D27E99-3CC1-4D02-8C01-540F58083***@microsoft.com... Show quote > If you must use or allow for Unicode or double-byte characters, such as, > Chinese you have to use nvarchar. Using varchar involves 8-bit > characters. > If your applications will only use 8-bit characters varchar is fine. > > "ad" wrote: > >> When we design a string field, we can use varchar and nvarchar. >> There are some field which will have Chinese word. >> I will use varchar if the field is just English character or digital. >> and use nvarchar if the field may contain Chinese word. >> >> Somebody recommend that it is better to use nvarchar for all string field >> for reason of purity. >> >> What is the best policy for selecting between varchar and nvarchar >> >> >> Hi..ad,
I think second approach is better, because using NVarchar for every field will result in more space consumtion in your database as they are stored 2-byte per character. So u can use varchar for pure english and nvarchar for fields which have chinese characters. Rahul Arora Mindfire Solutions My two cents.... space is cheap compared to the maintenance going forward and
complex logic to deal with different input type. I will stick with nvarchar for all Show quote "Rahul Arora" wrote: > Hi..ad, > > I think second approach is better, because using NVarchar for every > field will result in more space consumtion in your database as they are > stored 2-byte per character. So u can use varchar for pure english and > nvarchar for fields which have chinese characters. > > Rahul Arora > Mindfire Solutions > > Ah, memory is not so cheap--not when you have to share it. The larger your
data sets are, the more room they take in cache. The less rows in cache the slower your server. When you're counting users per second, the more ASP page instances you can get in memory at once the more you can serve. DBCS double the memory consumption of each field they use, double the size of the local variables that have to handle them, increase the complexity of the code that has to decode them. Sure, if you have an application that has to work on a DBCS platform, go for it. If you need to support multiple languages add DBCS-enabled tables but don't just go nuts and make all VarChars and Chars NVarChars or NChars. Yes, more than half of the world uses DBCS but many of the applications created here in the US and Canada, UK, Australia and New Zealand and many other countries don't need DBCS support. hth -- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "kaushas" <kaus***@discussions.microsoft.com> wrote in message news:18A411E7-996F-4074-8310-EC2ADACA91B3@microsoft.com... > My two cents.... space is cheap compared to the maintenance going forward > and > complex logic to deal with different input type. I will stick with > nvarchar > for all > > "Rahul Arora" wrote: > >> Hi..ad, >> >> I think second approach is better, because using NVarchar for every >> field will result in more space consumtion in your database as they are >> stored 2-byte per character. So u can use varchar for pure english and >> nvarchar for fields which have chinese characters. >> >> Rahul Arora >> Mindfire Solutions >> >> |
|||||||||||||||||||||||