SQL Command to insert Chinese Letters

前端 未结 3 1871
北恋
北恋 2021-01-23 06:23

I have a database with one column of the type nvarchar. If I write

INSERT INTO table VALUES (\"玄真\") 

It shows ¿¿ in the table. W

3条回答
  •  星月不相逢
    2021-01-23 06:54

    First of all, you should to establish the Chinese character encoding on your Database, for example

    UTF-8, Chinese_Hong_Kong_Stroke_90_BIN, Chinese_PRC_90_BIN, Chinese_Simplified_Pinyin_100_BIN ... 
    

    I show you an example with SQL Server 2008 (Management Studio) that incorporates all of this Collations, however, you can find the same characters encodings in other Databases (MySQL, SQLite, MongoDB, MariaDB...).

    1. Create Database with Chinese_PRC_90_BIN, but you can choose other Coallition:

      Select a Page (Left Header) Options > Collation > Choose the Collation

    1. Create a Table with the same Collation:

    2. Execute the Insert Statement

    INSERT INTO ChineseTable VALUES ('玄真');

提交回复
热议问题