LocalDB database Modify collation, fix Chinese character change question mark

Source: Internet
Author: User

vs2012,vs2013 new Lightweight database localdb, with this, developers will no longer have to install a large SQL Server, can easily test running small projects, since it is a lightweight database, it abandoned a large body, of course, will also be limited in function, One of them is its default collation, using the default collation, the Chinese data added from the Web site foreground display garbled or variable question marks in the database; This problem troubled me for several days, through a variety of search, finally found a solution; I would like to help you with the same confusion!
1. Right-click DB instance, new query modifies database to single user mode

ALTER DATABASE [DB name or full path] set Single_user with rollback immediate;
Go

2. Modify the collation (Chinese--Pinyin--not case sensitive)

ALTER DATABASE [DB name or full path] collate chinese_prc_ci_as;
Go

3. Reset to multi-user mode

ALTER DATABASE [DB name or full path] set Multi_user;

The

Where collation name consists of two parts, and the first half refers to the character set supported by this collation.
such as:
   chinese_prc_cs_ai_ws
First half: Refers to the Unicode character set, chinese_prc_ the pointer to the mainland simplified Unicode collation. The second half of the collation is the suffix meaning:

   _bin binary sort

   _ci (CS) is case sensitive, CI is not differentiated, CS is case sensitive: Select this option if you want comparisons to treat uppercase and lowercase letters as unequal.

   _ai (AS) accent-sensitive, AI not differentiated, as sensitive accent: Select this option if you want the comparison to treat accented and non-accented letters as unequal. If you select this option, the comparison also treats letters with different accents as unequal.

   _ki (KS) Whether the kana type is distinguished, KI does not differentiate, KS distinguishes kana: Select this option if you want the comparison to treat katakana and hiragana Japanese syllables as unequal.

   _wi (WS) Whether the width of the WI is distinguished, WS-Differentiated width: If you want the comparison to treat half-width characters and full-width characters as unequal, select the option

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.