Bulk Insert/BCP .xml file containing Chinese characters

  • Is it a single file composed of one XML node? Or is it a character-delimited file (i.e. one for BCP) that has a delimited column containing an XML-formatted string? Are there multiple rows each with a section of XML for your XML column?

    If it is just a single file, here is some sample text I put in a Notepad++ file encoded with the ISO 8859-2 character set (Eastern European)

    xml>??????,???????,????,??????,???,????,????,??????,????????,???????,??????,???????</xml>

    Then I used OPENROWSET to import:

    DECLARE @x XML

    SET @x = (

    SELECT * FROM OPENROWSET (BULK 'C:\Download\Russian.txt', SINGLE_NCLOB) AS xmlFile

    )

    SELECT @x

    I was able to see the result in Russian.

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply