(go) How to insert Chinese into SQL Server 2005

Source: Internet
Author: User

How do i insert Chinese into SQL Server 2005?after inserting the Chinese data into SQL Server 2005, the result of the query is??? and the Chinese is not displayed at allWorkaround:

1 about the database collation, will sql_latin1_general_cp1_ci_as change to chinese_prc_ci_as, see if you can solve this problem, but I can not directly manipulate the database, test not!

To modify the collation command for a database:

ALTER DATABASE [DatabaseName] COLLATE chinese_prc_ci_as

2 If the collation on the database is not changed and you want to display the Chinese characters correctly, it is recommended that you use all Unicode type fields, that is, the field types that start with n, such as Nchar,nvarchar, to display Chinese characters correctly. The Char type field you used above, in the collation above, should not support kanji by default.

3 If you do not want to change the collation and do not want to change the field type, then you need to change your SQL statement, for all characters, the front must also add N to display correctly. Refer to the following two statements for specific methods: query: SELECT * from Tb_cust where firstname=n ' Wang ' insert: Insert Tb_cust (Firstname,lastname,sex) VALUES (N ' Wang ' , n ' Xin Hao ', n ' Men ')

http://blog.csdn.net/zhou584859552/article/details/6439209

The first type can not be modified, the second type of modification still has no effect, the third kind of pro-test is available.

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.