Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Distinct languages in a database


Distinct languages in a database

Author
Message
Julia Esteban
Julia Esteban
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 2

Hi everybody

First of all, I must say that this is my first approach to collations, languages , sort orders, etc... :-)

I work in an international company, that works in different countries all over the world. Before now, we haven't had problems with languages because, almost everything was in spanish or english, so we can store all the data correctly. But now, We have to store german messages in tables, and I don't know what to do. Because the apllication is still in english but some columns must show german characters.

What do you recommend me?

We'll have to store chinese in three months time !!! so, i wonder if there is a way to be prepare to store this data in the same server.

Thank you very much in advance!!! (and sorry for my english)

Julia.


Sergi Langa
Sergi Langa
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 1

I do not know what your case exactly is but next two proposes are exposed:

One solution is to have different databases with different collations (one for each language you need).

If you need to maintain all your data in one database next will be the right solution:

If you have to store chinese characters, spanish, german, etc. in just one database, one solution (I think the only one) is to convert your character datatypes to unicode:

  • Instead of char datatype you have to use nchar datatype.
  • Instead of varchar you have to use nvarchar datatype.
  • Instead of text you have to use ntext datatype.

nchar, nvarchar and ntext use unicode characters that are saved with two bytes per character instead of one byte. Unicode columns are almost independent of the collation of your database.

On the other hand, query sentences are affected. For exemple, you will have to use:

insert into table1 values (N'hello') instead of: insert into table1 values ('hello')

However, globalization must be studied carefully. I recommend to investigate more before you decide the final solution.

Here you have a good link to start to know more about unicode:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/sql_dataencoding.asp


Julia Esteban
Julia Esteban
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 2

Ok! Thank you

I will start with the second option! :-)


Gift Peddie
Gift Peddie
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3474 Visits: 14456

You need to localize both the database and application. You can download the Enterprise localization tool kit from the link below and use the second link to localize the application in Visual Studio .NET. A quick trick put XML and others in notepad and save the file as Unicode. Try the links below to get started. I am assuming you know NVarchar and NChar are 4000 and NText is 2gigs. Hope this helps.

http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6fb09f-f25c-48e9-9e26-b55144600da1&DisplayLang=en

http://www.aspnetresources.com/blog/unicode_in_vsnet.aspx

Kind regards,

Gift Peddie



Kind regards,
Gift Peddie
Perry-300990
Perry-300990
Valued Member
Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)

Group: General Forum Members
Points: 67 Visits: 6
Also, as you mentioned Chinese, be aware that the assumption that every Unicode character (codepoint) can be represented as two bytes, is an old assumption from a ten-year old Unicode encoding called UCS-2LE, which is what was used in Windows NT, and which is still used (I think) by Microsoft SQL Server, and *!* which is a safe assumption outside of the Chinese language.

But if you get into Chinese, you will have to decide if Unicode 2.0 (the old list that had no more than 65536 characters, and therefore could be represented in a fixed-size 2-byte encoding) is good enough -- the issue that may come up is GB18030, which is newer than that, and has more Chinese characters than fit in that old version.

UTF-8 is a modern encoding, and holds all Unicode characters, but, SQL Server 2000 at least cannot deal with it natively. I don't know about SQL Server 2005.
Gift Peddie
Gift Peddie
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3474 Visits: 14456

Try the link below I covered SQL Server Chinese collation in detail in another forum. Hope this helps.

http://forums.asp.net/1067798/ShowPost.aspx

Kind regards,

Gift Peddie



Kind regards,
Gift Peddie
Perry-300990
Perry-300990
Valued Member
Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)

Group: General Forum Members
Points: 67 Visits: 6
Gift Peddie, I don't understand how that link is at all relevant -- I don't see any mention of GB18030 in it -- in fact, it looks like mostly just codepage numbers & names copied & pasted in from Books Online or somewhere?

Sorry if I've missed the point-- could you kindly explain the relevance?


PostScript: I just realized that you probably were responding to earlier thread content, not to my babble^h^h^h^h^hpost, so that is probably why I was confused.

(I've also just realized that since these forums are inconveniently hidden behind some login page. they may not be getting googled--which would kind of make them a bad place for discussions?)
anwar_dload
anwar_dload
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 2
hi julie,

Have you got solution for storing Chinese language in sql server. can you please explain me.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search