Solved

SQL Collation with support for Japanese

Posted on 2008-10-16
12
2,362 Views
Last Modified: 2012-06-21
Hello, I have an SQL Server 2008 database using SQL_Latin1_General_CP1_CI_AS right now. It seems that Japanese text shows up as question marks...so I was going to change it to Japanese_CI_AS or Japanese_Unicode_CI_AS, but I'm not sure what the differences are, or if these are even the ones I should choose. It's mostly going to be filled with Latin-based text, but there are also some fields that should accept Japanese.

Any advice would be appreciated.

Thanks~
0
Comment
Question by:YoungBonzi
  • 7
  • 4
12 Comments
 
LVL 31

Expert Comment

by:James Murrell
ID: 22735394
we had this a will ago and the then DBA used http://developer.mimer.com/collations/index.tml
0
 
LVL 8

Author Comment

by:YoungBonzi
ID: 22735427
Thank you for the option, but I want to stick with Microsoft technology.
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 125 total points
ID: 22739253
Well, unicode is multi-byte and needed for "special" characters. So you will want to change to a unicode basis. That also means making sure datatypes are unicode as well - e.g. instead of varchar, it then becomes nvarchar.

There is some reasonable documentation about "international considerations [SQL Server]" in books on-line and highly recommend you research that before you change anything.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 51

Expert Comment

by:Mark Wills
ID: 22739297
Sorry, might have given the wrong impression there... Have been a bit too brief with some of my answers lately...

The database collation is not as important as the datatype being unicode and then making sure it "knows" it is dealing with unicode.

For example... Try this quick example :
create table tbl_japanese_example_1 (place nvarchar(200))
 
insert tbl_japanese_example_1 values ('ۇ osaka')
 
select * from tbl_japanese_example_1
 
 
create table tbl_japanese_example_2 (place nvarchar(200))
 
insert tbl_japanese_example_2 values (N'ۇ osaka')
 
select * from tbl_japanese_example_2

Open in new window

0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 22739315
Guess what - this website is not unicode !
Japanese-Test.zip
0
 
LVL 8

Author Comment

by:YoungBonzi
ID: 22763962
Sorry, I haven't been getting any email notifications so I never bothered checking back. Thank you for the solution mark wills, that's good to know about the datatypes.

What I wound up doing was, in Management Studio, changing the collation on individual datatypes that could possible receive Japanese to the Japanese_Unicode collation (I was unaware this could be done). I noticed that text indeed becomes ntext, and varchar becomes nvarchar. Like you recommend.

I will probably just leave things as they are, because it's working fine...but are you in fact saying that I don't have to change the collation and just change the datatype?
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 22764022
Yes, the collation will change things like sort sequences and such like, and might want to consider the most appropriate collation, but the secrete to handling those wonderful character sets is in being unicode enabled.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 22764030
Oh, and that attachment a couple of postings back does show the database (latin) being able to correctly render Kanji becuase they are unicode data types.
0
 
LVL 8

Author Closing Comment

by:YoungBonzi
ID: 31506910
Ahhhhhh...thank you, I wish I'd read your reply earlier.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 22764042
Except the top one should have been just varchar and the second one nvarchar - sorry about that.
0
 
LVL 8

Author Comment

by:YoungBonzi
ID: 22764043
Yep, the unicode is preserved. I figured that's what you were showing me...I played it out in my head because I didn't want to execute it on my DB. Still a bit skittish about playing around with it.

Thanks again~
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 22764062
Yep, you got it... and thank you too...
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question