The characters of a database's table's volumn_name is replaced by question marks, how to fix it ?

Tina Yi 0 Reputation points
2024-04-18T07:29:57.3566667+00:00

Hi everyone, my database have a table which volumn_names are Chinese characters. when I use " SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'table-name '; " the volumn_name display correctly, but if I use " select volumn_name from table-name ", the content display correctly ,but the volumn_name it'self disply is ??. how to fix this problem ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,737 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. CosmogHong-MSFT 23,166 Reputation points Microsoft Vendor
    2024-04-18T09:45:35.4+00:00

    Hi @Tina Yi

    What is your default collation designations? See: Server-level collations

    If you need Chinese column names, try something like this:

    CREATE TABLE ChineseTable 
    (
     ID INT PRIMARY KEY,
     volumn_name NVARCHAR(100) COLLATE Chinese_PRC_CI_AS 
    );
    

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Tina Yi 0 Reputation points
    2024-04-18T23:50:37.9266667+00:00

    Thank you CosmogHong-MSFT,but it not work.

    My default collation designations is Chinese_PRC_CI_AS

    it's the column_name itself can't display correctly, not the content.

    0 comments No comments

  3. CosmogHong-MSFT 23,166 Reputation points Microsoft Vendor
    2024-04-19T03:20:17.23+00:00

    Hi @Tina Yi

    Since I cannot reproduce this issue, here are some additional suggestions you might refer to.

    • Ensure that SSMS is configured to use a font that supports Chinese characters. You can adjust the font settings in SSMS by going to "Tools" > "Options" > "Environment" > "Fonts and Colors". Select a font that includes Chinese characters, such as "Microsoft YaHei" or "SimSun".
    • Upgrade the SSMS to the newest version.
    • Make sure that SSMS is configured to display characters using the correct encoding. You can check the encoding settings in SSMS by going to "Tools" > "Options" > "Environment" > "International Settings".

    Remember to restart after any modifications.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments