Varbinary into XML

  • Hello,

    I have a column with type 'varbinary' containing signatures.  What is the easiest way to store the value of this field in an XML file so I can pass on that XML to another group (which doesn't have MSSQL Server).

    Thank you

  • did u get this one resolved?


    Everything you can imagine is real.

  • Easiest way for you is to use FOR XML RAW and BINARY BASE64.  Example is from BOL:

    
    
    USE AdventureWorksGOSELECT ProductPhotoID, ThumbNailPhotoFROM Production.ProductPhotoWHERE ProductPhotoID=1FOR XML RAW, BINARY BASE64 ;GO

    produces

    
    
    <row ProductModelID="1" ThumbNailPhoto="base64 encoded binary data"/>

    Of course, it will be up to the destination application to handle to blob data appropriately.

    Hope this helps



    Mark

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

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