Using OpenXML Part II

  • Vasant Raj

    SSCommitted

    Points: 1835

    Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rVasant/usingopenxmlpartii.asp

  • Daniel Fabia

    Valued Member

    Points: 54

    Great article. Have you tried this in real world application especially in web application.

    Thanks!

  • Vasant Raj

    SSCommitted

    Points: 1835

    thnx.

    I have not tried this in a web application...

    but i think it will work the same way... coz this will technique will be useful if you are calling sp's from one another...

  • Daniel Fabia

    Valued Member

    Points: 54

    I actually tried this in a .NET Web Application before. I want to insert data in one database call from the a web application.

    My big problem with this is the OutOfMemory error/exception when assigning the XML string to a string variable. This problem occurred if the datasource is too large (50,000 thousands record, 30 columns). That string variable is suppose to be passed the stored procedure. Haven't solve this problem and I have to revert back to old way of looping and call a database insert.

    What way do you use OpenXML?

  • Spunky-175138

    SSC Enthusiast

    Points: 106

    Great idea!! I hadn't thought to try this.  I wish i had read this a couple years back.  It would really have been helpful in a few situations

  • Muthukkalavalli

    SSC Rookie

    Points: 28

    I Need uploading an XML file to SQL Server... The scipt should use MS SQL Server Bulk import capability (OpenXML)...How can i do this.

  • SDM

    SSCommitted

    Points: 1560

    Thank you.  One of those "obvious when you think about it for more than a couple of minutes" situations, but aren't they they the best sometimes?

    Good tip.

  • Vasant Raj

    SSCommitted

    Points: 1835

    You can store your XML data into your database tables by defining a column of VARCHAR type.

    You use OPENXML if you want to query your XML data.

  • Antonio Hernandez

    SSC Rookie

    Points: 25

    Excellent article, congratulations...

    Antonio Hernández

  • SDM

    SSCommitted

    Points: 1560

    Muthukkalavalli,

    What you are probably after is the SQLXMLBulkLoad tool, available as a separate download.  There's a How-to article at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlxml3/htm/bulkload_6bos.asp and several other resources at other pages.  Search for SQLXMLBulkLoad.

     

    Good luck

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

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