Insert special characters into table via XML

  • I am using sql server 2000 and trying to insert bulk records into a table using XML format. Below is the sample XML format I'm using.

    <?xml version="1.0" encoding="iso-8859-1"?><batch><data><cardid>010500350000</cardid><pinnumber>•GZ§-ɱÚ</pinnumber></data></batch>

    And the code to insert it to the table is as follows,

    DECLARE @BATCHUPLOAD_XML text

    DECLARE @idoc INT

    EXEC sp_xml_preparedocument @idoc OUTPUT, @BATCHUPLOAD_XML

    INSERT INTO test_table(cardid,pinnumber) SELECT cardid,pinnumber

    FROM OPENXML (@idoc, '/batch/data')

    WITH (cardid varchar(100) '@cardid', pinnumber varchar(100) '@pinnumber')

    This is working fine for normal characters. But if I use an encoded characters like •GZ§-É±Ú or NX”(͵ÒzÉÓ I found that some characters (like • or ”) are replaced by question mark(?) in the database. This is causing lot of issues to me. Any help at the earliest will be greatly appreciated.

    Thanks,

    Rakesh.

  • can anybody answer my question?

Viewing 2 posts - 1 through 1 (of 1 total)

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