Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
XML
»
Non unique id xml node -flatten and import in...
Non unique id xml node -flatten and import in to sql
Rate Topic
Display Mode
Topic Options
Author
Message
ganesh.sundara
ganesh.sundara
Posted Thursday, October 25, 2012 5:32 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, October 30, 2012 1:32 PM
Points: 3,
Visits: 26
Hi i need to import the xml in to sql. there is no item or value in invoice node its under invoice header node. please help me to import this in to sql
i want to store each invoce and its item details in sql tables
<invoicetransmission>
<invoicetransmissionheader>
<invoiveid>333</invoiceid>
</invoicetransmissionheader>
<invoice>
<invoiceheader>
<invoicenumber>33</invoicenumber>
<items>
<itemid>44</itemid>
</items>
<invoice>
<invoice>
<invoiceheader>
<invoicenumber>323</invoicenumber>
<items>
<itemid>424</itemid>
</items>
<invoice>
</invoicetransmission>
Post #1376931
arthurolcot
arthurolcot
Posted Thursday, October 25, 2012 6:45 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 12:58 AM
Points: 1,721,
Visits: 1,401
To shred the xml to flat tables, you will need to use some of the xml data type methods and maybe a little bit of XQuery. the nodes() method will help you shred the xml into a relational format. the value() method will also help you extract data as well.
Here are some links to get you started.
http://msdn.microsoft.com/en-us/library/ms188282.aspx
http://msdn.microsoft.com/en-us/library/ms178030.aspx
http://msdn.microsoft.com/en-us/library/ms189075.aspx
However, have you posted live data in your example? it does look surprisingly realistic? and the addresses in the xml seem to be genuine for customers in the xml.. I hope I'm wrong and that the data is just test data and I wish that I had such good quality test data to work with
Post #1376955
Dave Convery
Dave Convery
Posted Thursday, October 25, 2012 6:51 AM
Forum Newbie
Group: Administrators
Last Login: Yesterday @ 8:20 AM
Points: 7,
Visits: 1,364
Have you obfuscated your data in your post so you're not revealing anything you shouldn't be? This looks like an actual invoice.
Post #1376959
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.