|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 3:07 PM
Points: 37,687,
Visits: 29,946
|
|
declare @test VARCHAR(20) SET @test = 'resumé' select @test There's a difference between extended ASCII and unicode.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 10:43 AM
Points: 1,146,
Visits: 1,848
|
|
GilaMonster (12/4/2008)[hr There's a difference between extended ASCII and unicode. True, but the support of extended (8-bit) ASCII is also governed by the collation of the database and the calling application, among other things.
Best bet is to to be global and use Unicode. If the application is .Net, it is a no-brainer as .Net is Unicode.
(PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 21,357,
Visits: 9,535
|
|
JohnG (12/4/2008) Note that even in America, extended ASCII is very common. Just think of all of peoples names that have accents in them. Or the word resumé. Let alone, there is this province in Canada that has French as the standard language.
So if you are designing a new system, use NCHAR and NVARCHAR. Trust me and you'll thank me later.
I'm from Quebec... and varchar is more than enough to cover all our words!!!
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 7:42 AM
Points: 2,802,
Visits: 7,103
|
|
Ninja's_RGR'us (12/4/2008)
JohnG (12/4/2008) Note that even in America, extended ASCII is very common. Just think of all of peoples names that have accents in them. Or the word resumé. Let alone, there is this province in Canada that has French as the standard language.
So if you are designing a new system, use NCHAR and NVARCHAR. Trust me and you'll thank me later.I'm from Quebec... and varchar is more than enough to cover all our words!!!
Varchar will handle any Latin/Romance language easily so I can't see any French words causing an issue, but you must have names of people/business that are from different aplhabets.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 10:43 AM
Points: 1,146,
Visits: 1,848
|
|
I'll qualify my responses as follows:
If you are designing and building a system that will be used within a single language culture then by all means choose the proper database collation and use VARCHAR. If, however, your system will be used by different cultures, then you should use NVARCHAR (Unicode).
If your system is a web-application (e.g., a SaaS offering) it should be Unicode. Also note that a lot of companies are global. Those that are not, may be in the future. If not from expansion they could be as a result of a merger or acquisition (M&A).
My company has a SaaS offering that is used globally. Some of the customers are multi-lingual -- i.e., they have global offices. Consequently, the data placed into the system is from all languages and character sets.
BOL links supporting the above: http://technet.microsoft.com/en-us/library/ms187828(SQL.90).aspx Note the reference to (North America) Mexico, Quebec, Canada and US. http://technet.microsoft.com/en-us/library/ms188325(SQL.90).aspx
Edit: Added BOL links
(PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:48 PM
Points: 7,088,
Visits: 7,143
|
|
Carla Wilson-484785 (12/2/2008) AND not too long ago, there was a forum post about trailing blanks in nvarchar, and how that can be a problem in comparisons, etc. unless you use RTRIM(). Belated response: If the ANSI_PADDING option is set ON varchar has exactly the same trailing blanks issues as nvarchar; and the ability to set it OFF will be removed from SQL Server very soon (MS advice has for years been to keep it on at all times; setting it OFF creates big problems for indexed views and for table indexes involving computed columns, amongst other little problems) so those trailing blank issues should not be a factor in deciding between nvarchar and varchar - if you use varchar to avoid the trailing blanks issue your code will stop working in a new SQL Server release sometime soon.
BTW, what on earth is this topic doing in the relational theory forum? I don't see the connection.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 7:31 AM
Points: 653,
Visits: 631
|
|
Ninja's_RGR'us (12/4/2008)
JohnG (12/4/2008) Note that even in America, extended ASCII is very common. Just think of all of peoples names that have accents in them. Or the word resumé. Let alone, there is this province in Canada that has French as the standard language.
So if you are designing a new system, use NCHAR and NVARCHAR. Trust me and you'll thank me later.I'm from Quebec... and varchar is more than enough to cover all our words!!!
Same. Quebec Power!
|
|
|
|