none
BCP Import UTF8 data file to MSSQL

    Question

  • Hi Guys,

     

    I have a UTF8 data files as following

     

    Data files:

    First line display the Title, will not import to database;|||||
    2|1|20080807 02:00|20080201 14:00:00|1.0000|第三行

    3|1|20080807 13:00:00|20080201 00:00:00|1.0000|第三行

    4|1|20080807 15:23:00|20080201 00:00:00|1.0000|第三行

     

    Format files:

    9.0
    6
    1       SQLCHAR       0       10      "|"        1     numval   Chinese_Hong_Kong_Stroke_90_CI_AS
    2       SQLCHAR       0       10      "|"        2     engval   Chinese_Hong_Kong_Stroke_90_CI_AS
    3       SQLCHAR       0       24      "|"        3     datetimeval  ""
    4       SQLCHAR       0       24      "|"        4     dateval   ""
    5       SQLCHAR       0       41      "|"        5     decval    ""
    6       SQLNCHAR      0       200     "\r\n"     6     chival  Chinese_Hong_Kong_Stroke_90_CI_AS

     

    I try to use format file import to Sql Server by the chinese character become unknow character. Is there have anyway I can import correct chinese character into Sql Server by using format file.

     

    Also, why bcp does not recognize first line if I do not add enough of "|" symbols at the end of first line.

    Friday, July 18, 2008 9:14 AM

Answers