SQL Server Chinese garbled explanation ~

Source: Internet
Author: User
server| Chinese | Chinese garbled

Run sp_help "Your table" to get the collation setting for the column. In order to store Chinese correctly, your should set the collation be:
Chinese_prc_ci_as
or chinese_stoke_ci_as

Char/varchar data type is ANSI char which must define a code page. If you set the collation is sql_latin1_general_cp_ci_as, it can only store Latin characters. In an order to store Chinese character in a char column, your have to set the collation is Chinese_prc_ci_as or Chinese_stok E_ci_as which has a Chinese code page defined.

Nchar/nvarchar Collumn is different, your can store any Unicode character include Enlish, Chinese, Japanese in one column.

In term of input Chinese character, the character constant would use database ' s collation. Thus, if the database ' s collation is not Chinese collation, there are no way to input Chinese char/varchar data, such as
' Chinese ' would be treated as '?? '. But for Nvarchar/ncar, can input it
On any collation. such as N ' Chinese ' would be treated as two Unicode chars




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.