SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Reading Data From XML through Script component


Reading Data From XML through Script component

Author
Message
quillis131
quillis131
Right there with Babe
Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)

Group: General Forum Members
Points: 720 Visits: 572
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).
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50195 Visits: 21151
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.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38352 Visits: 14411
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
quillis131
quillis131
Right there with Babe
Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)

Group: General Forum Members
Points: 720 Visits: 572
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?
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38352 Visits: 14411
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
quillis131
quillis131
Right there with Babe
Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)Right there with Babe (720 reputation)

Group: General Forum Members
Points: 720 Visits: 572
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
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38352 Visits: 14411
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search