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