Distinct languages in a database

  • 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.

  • 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

  • Ok! Thank you

    I will start with the second option! 🙂

  • 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

  • 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.

  • 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

  • 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?)

  • hi julie,

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

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply