MS SQL Server installed in the English version of the operating system, the Chinese text segment does not match

Source: Internet
Author: User

In the English version of the operating system installed in MS SQL Server, a Chinese text field will appear that cannot be matched to. The reason for this is that the collation of MS SQL Server installed in an English environment does not include Chinese.

So the solution is to change the collation of MS SQL Server: In general, just right-click the database->properties->optiones->collation->chose "Chinese RPC CI as"- >ok. If execution succeeds then OK.

However, if there are some temporary table dependencies set up in the database, execution will be an error.

The solution is as follows:

Export data, delete database, re-create database, import data.

Using the Database administration tool: Select Database, right-click menu->tasks->export data->data source:sqlserver Native Client XX. Xx->destination:flat File Destination->next...->finish.

Then re-create the database, note! Set Options->collation->chose "Chinese RPC CI as" on creation. Then restore the table structure, and then import the data, the reverse export step is ready.

If there is an error, it is probably the reason for the table structure of the new database, and a good way is to delete all the table structures. SQL is as follows: (from Alexchen)

--Remove all ConstraintsDECLAREC1cursor  for    Select 'ALTER TABLE ['+ object_name(parent_obj)+ '] Drop constraint ['+Name+']; '     fromsysobjectswhereXtype= 'F'OpenC1Declare @c1 varchar(8000)Fetch Next  fromC1 into @c1 while(@ @fetch_status=0)    begin        exec(@c1)        Fetch Next  fromC1 into @c1    EndCloseC1deallocateC1--Delete all tables in the databaseDeclare @tname varchar(8000)Set @tname="'Select @tname=@tname +Name+ ','  fromsysobjectswhereXtype='U'Select @tname='drop table' +  Left(@tname,Len(@tname)-1)exec(@tname)

And then import the data.

Import and export data, refer to Rei Tu.

Collation: Reason

MS SQL Server installed in the English version of the operating system, the Chinese text segment does not match

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.