locked
Japanese characters in Sql Server RRS feed

  • Question

  •  

    hi all,

     

    In my Sql server 2000 database the japanese characters are showing ? marks. I have restored my database from a back up taken from another database which is showing the characters are in proper way. Please give me a solution for this problem. Thanks in advance

     

    Regards,

     

    Wednesday, October 31, 2007 2:04 AM

Answers

  • I made a test :

    I made a table :

    CREATE TABLE [dbo].[Test_Japanese](

    Angel [varchar](50) COLLATE Japanese_CI_AI NULL,

    Beer [varchar](50)

    ) ON [PRIMARY]

    for b the collation is database default (SL_latin_general_CP1_CI_AS)

     

    for the command

    insert into dbo.Test_japanese(a,b) values('ウィキペディア -','ウィキペディア -')

    the output is

    a b

    -------------------------------------------------- --------------------------------------------------

    ??????? - ??????? -

     

    (1 row(s) affected)

     

     

    for the command

     

    insert into dbo.Test_japanese(a) values('ウィキペディア -')

     

    the output is

    a b

    -------------------------------------------------- --------------------------------------------------

    ??????? - ??????? -

    ??????? - NULL

    (2 row(s) affected)

     

    For the command

    SET LANGUAGE japanese

    select * from dbo.Test_japanese

     

    the output is

    言語設定が 日本語 に変更されました。

    a b

    -------------------------------------------------- --------------------------------------------------

    ??????? - ??????? -

    ??????? - NULL

    (2 row(s) affected)

    If i change the collation for the db (It was latin)  :

    alter database test7 collate Japanese_CI_AI

     

    the output for

    insert into dbo.Test_japanese(a,b) values('ウィキペディア -','ウィキペディア -')

     is

    a b

    -------------------------------------------------- --------------------------------------------------

    ??????? - ??????? -

    ウィキペディア - ??????? -

    (2 row(s) affected)

    The same thing  is after changing the collation of the column (to japanese); new data is insered in the new collation.

     

     

    Check if all columns or tables are the same collation (japanese) in the source

    To the other part if source database has japanese collation the new restored database has the same collation even database default collation is different and your situation is curious.

    And at level server you can change collation (see in Books Online)

     

    PS. Even i try to learn japanase i don't know what it mean ウィキペディア -', from  my test.Please forgive me if ...

     

    Kunnichi wa

    • Marked as answer by Saji dk Tuesday, April 7, 2009 2:10 AM
    Wednesday, October 31, 2007 9:17 AM