Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chinese characters in table show up as ?? 2

Status
Not open for further replies.

tk808

Technical User
Sep 7, 2004
146
JP
Hello,

SQL 2k5, WS 2k3. I have a table that uses Chinese/Japanese characters. Typing these in the table itself is fine, but when using transact sql, it displays the chars as ??. I made sure it's unicode set:

LastName nvarchar(20) not null,

Any ideas please?

Thanks,

 
What's your collation?

Ignorance of certain subjects is a great part of wisdom
 
Beside Collation if your server does not have IME installed it won't know how to translate the collation. I've had databases that have had Kanji in them in the past. Check to make sure IME is installed.


- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Interesting....

I was just playing around a little. [smile]

If you run...

Select nchar(3228)

in Query Analyzer, you get...

[tt]
----
?

(1 row(s) affected)[/tt]

Well... actually, you see a square box. If you copy/paste the output to wordpad, then you see the symbol produced above.

Since your end users shouldn't be using query analyzer (or management studio), then perhaps you don't have to worry about this. As long as they can see the correct symbol in whatever application the end user will be using.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
George that is correct, But here is what I've learned about that. Eventhough those characters look similar to kanji it is actually jimberish. I had to load a table from a text file filled with kanji. Because I didn't have IME installed on the server it was converting it to the box which then translated to jiberish when my users in Japan tried to view the data.
Once I installed IME and ran the import everything was fine.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Thanks for your quick posts. I double checked my collation and saw that it was defaulted to Latin. I changed this to Japanese_CI_AI_KS_WS and it worked beautifully.

I also read somewhere that you can have a separate collation for each column in the table. Haven't found out how to do this yet nor a situation that I'd need this yet but might be interesting to look into later on.
 
tk808 - You can handle this in the table creation script. Here is a snippet of one I was working on today:

Code:
CREATE TABLE [AGEIN] (
	[ADD1] [nvarchar] (36) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ADD2] [nvarchar] (36) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

Of course, I don't think you need to specify the default collation, but as this shows you could use

Code:
COLLATE Japanese_CI_AI_KS_WS

on the columns you wanted to apply this collation to.

Here is a bit from msdn on altering an existing column's collation.
Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top