SQL Server 2008R2 encountered a problem with bcp importing various Chinese characters

Source: Internet
Author: User

Today to play bcp import data, there is a file format, there are Chinese string problems ... The following is the course, and share with you, hope not to go my detour

The main table is a translation table, a file containing dozens of languages, so it is easy to find the problem.

0. Use the most commonly used statements to guide the data

BCP DB. TBOWNER.TB in File-s-u-p-r-t-C came, Dead Island guide not in

1, open the file, first found that the file encoding using UTF-16 ... It is no wonder that the death cannot lead in. Then convert the file into UTF-8, no error! And it can lead in!!

2, happy time less than 30 seconds, a check data ... All garbled, and back to the original point ...

3, cool, check the document, found that in fact, BCP is not supported UTF-8 code page, and then recall that UTF-8 is a variable length format, with UE view data document. Chinese and other languages are encoded using 2 characters, the English is encoded in 1 characters, and then I think of first turning the document into a wide character, here I turn to Unicode characters to handle.

4, bcp DB. TBOWNER.TB in File-s-u-p-r-t-W Use the original statement, say-C changed to-W ~ Import success, view data Error ~ Resolution ~

This is the knowledge is not a solid road detour ...

BCP using tool notes: http://msdn.microsoft.com/zh-cn/library/ms162802.aspx

SQL Server 2008R2 encountered a problem with bcp importing various Chinese characters

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.