insert binary base64 xml data

  • hi,

    i create an xml in wich there is a binary data so i've to use the syntax

    select * from tba_user for xml auto bibary base 64,

    the i have to insert this xml into another db using something like this:

    SET @xmlDoc = (

    SELECT Q.BulkColumn

    FROM OPENROWSET(BULK 'c:\xmlfile.xml', SINGLE_CLOB) AS Q);

    EXEC sp_xml_preparedocument @hdoc OUTPUT, @xmlDoc;

    INSERT tba_user

    SELECT * FROM OPENXML (@hdoc, '/root/tba_user ', 3)

    WITH tba_user

    The problem is that the binary data is inserted with base64 codec so when i show the binary field in my application, it results corrupt

    there is a way to convert the selected base64 binary xml data before insert it

  • instead of using AUTO try to use RAW

    SELECT

    * FROM tba_user FOR XML RAW, BINARY BASE64

     


    Everything you can imagine is real.

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

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