Reading Data From XML through Script component

  • Goal : Need to pull data from XML file (800MB).

    Note: I tried to do with XML task and XSLT but couldn't make it work, it gives me an Out of Memory expection error.

    http://beyondrelational.com/modules/2/blogs/106/posts/11130/ssis-read-xml-file-in-script-component-as-source.aspx

    I end up searching above link.

    Issues : I can't get this to work either. My script task complaints me when I try to AddRow() function, (Please go throw the link if you can understand C# )

    Script complaints "doesnot contain definition and no extension method can be found (are you missing a using directive or an assembly reference?)"

    Help need: Plz suggest me a solution to read data frm XML either through new process or Please guide me to help out of this error thrown while writing C# script (in the link above).

  • quillis131 (2/14/2013)


    Goal : Need to pull data from XML file (800MB).

    Note: I tried to do with XML task and XSLT but couldn't make it work, it gives me an Out of Memory expection error.

    http://beyondrelational.com/modules/2/blogs/106/posts/11130/ssis-read-xml-file-in-script-component-as-source.aspx

    I end up searching above link.

    Issues : I can't get this to work either. My script task complaints me when I try to AddRow() function, (Please go throw the link if you can understand C# )

    Script complaints "doesnot contain definition and no extension method can be found (are you missing a using directive or an assembly reference?)"

    Help need: Plz suggest me a solution to read data frm XML either through new process or Please guide me to help out of this error thrown while writing C# script (in the link above).

    I can understand C# and read the link, which presumably is a working solution.

    I would guess that either:

    a) The Script Component config has been set up wrongly, or

    b) Your C# code has one or more syntax errors

    but guesswork is as far as I can go without more info.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • 800MB is an awfully large XML document. Note that when represented in memory as an XMLDocument object it will occupy far more space that just the file on disk. How much RAM is on the machine you are trying this on?

    Try with a smaller version of the file with the same structure and see if you can get a proof-of-concept done.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • opc.three (2/15/2013)


    800MB is an awfully large XML document. Note that when represented in memory as an XMLDocument object it will occupy far more space that just the file on disk. How much RAM is on the machine you are trying this on?

    Try with a smaller version of the file with the same structure and see if you can get a proof-of-concept done.

    I was able to load 200MB of file size through XSLT script in XML task. But Working with 800MB File size is an issue here.

    Is there any better solution you can think of to load 800MB of XML file?

  • I think XMLReader is going to scale better because it dies not have to load the entire file into memory to work with it, but in using it you're signing up for some C# coding.

    You could also look into SQLXML bulk load. I have used it successfully in the past but not for anything close to the size file you're dealing with, maybe 50MB tops iirc.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • opc.three (2/15/2013)


    I think XMLReader is going to scale better because it dies not have to load the entire file into memory to work with it, but in using it you're signing up for some C# coding.

    You could also look into SQLXML bulk load. I have used it successfully in the past but not for anything close to the size file you're dealing with, maybe 50MB tops iirc.

    Can you spell out C# code with XML reader? I could make use of it plz

  • Use of XMLReader is an iterative approach so you'll be writing code with the structure "for each node in document, do something" and those for each statements can be nested. The actual code will depend on your XML structure. You'll find numerous samples of this online.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 7 posts - 1 through 6 (of 6 total)

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