Accent-Insensitive, Accent Sensitive, a keyword, e é fuzzy query

Source: Internet
Author: User

I recently asked a European old man to query jos é, But he entered jose, and thought that SQL Server should not be checked out for him, but the old man asked to find out, and said that google can all be implemented. If it cannot be implemented, it will not be released ~~ First, BS, and then I came back to study this, but found it difficult to get started. I don't know what the keyword is ~~

After searching for more than one night and half a morning, you can find it. It turns out that when SQL Server DB create is used, you can select the character set, Accent Sensitive or Accent Insensitive. At last, you don't know the keyword, knowing the keywords makes it easy. I started to think about encode, decode, and so on ~, Ah

 

Now let's summarize how to change the collate of the created database.

 

Update the original data Step 1 to know the number of updated collationid 2. run The following code. When run alter database BQEGSRNet10E9 COLLATE Chinese_PRC_CI_AI, the database cocould not be exclusively locked to perform The operation ...... In this case, you need to change the database to a single user so that you can run the code just now. The reason should be that there are constraints.

 

Update db SQL script

 

Alter database BQEGSRNet10E9 COLLATE Chinese_PRC_CI_AI

EXEC sp_configure 'Allow updates', 1 RECONFIGURE WITH OVERRIDE
GO
--
UPDATE syscolumns SET collationid = 61476.
---------------------------------- ^ This id must be found in the help to match the rule you want to change
WHERE collation = 'Chinese _ PRC_CI_AS'
---------------- ^ This is the old rule
And id in (SELECT id FROM sysobjects WHERE xtype = 'U ')
GO
EXEC sp_configure 'Allow updates', 0 RECONFIGURE WITH OVERRIDE
GO

 

Of course, there are other solutions, but you need to work hard on the query column, and you have to set each place to be queried, that is, this is the collate

 

SELECT * FROM dbo. test_table
WHERE remark COLLATE Latin1_General_CI_AI LIKE '% e %'

 

 

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.