473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Load XML with nested tables into SQL Server

Hi all

I have problems loading XML data into SQL Server.
What is the best way to go ? I am new in using XML documents.
I have tried to do it with "Integration Services" and
also with "XmlTextReader", "XPathDocument", "DataSet.ReadXML" ...

None of this is working well because my XML document
has nested tables and in XML documents I dont see any
relations ...

Thanks for any comment .

Best regards
Frank

Here is what the XML looks like:

<?xml version="1.0" encoding="iso-8859-1" ?>
- <Test>
- <Transactions>
- <Trx>
<TrxCol1>false</TrxCol1>
<TrxCol2>SWAP</TrxCol2>
- <calendars>
<calendar>CHF</calendar>
</calendars>
- <legs>
- <leg>
<LegCol1>true</LegCol1>
- <calendars>
<calendar>JPY</calendar>
<calendar>GBP</calendar>
</calendars>
<LegCol2>false</LegCol2>
- <fixings>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-19</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-20</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-21</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-22</FixingCol2>
</fixing>
</fixings>
</leg>
</legs>
<nr>XY88.6</nr>
</Trx>
- <Trx>
<TrxCol1>true</TrxCol1>
<TrxCol2>BOND</TrxCol2>
- <calendars>
<calendar>EUR</calendar>
</calendars>
- <legs>
- <leg>
<LegCol1>true</LegCol1>
- <calendars>
<calendar>USD</calendar>
<calendar>GBP</calendar>
</calendars>
<LegCol2>false</LegCol2>
- <fixings>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-19</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-20</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-21</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-22</FixingCol2>
</fixing>
</fixings>
</leg>
</legs>
<nr>XY88.6</nr>
</Trx>
</Transactions>
</Test>
Jun 27 '08 #1
1 1707
It will be easier to understand your problem if you describe the tables. I
think problem is becuase the way calendars is related to Transactions and
legs. I think if you remove calendars from the xml file then you can use
dataset.ReadXMLSchema and dataset.ReadXML to load the data.
You might have to create an empty dataset by querying your tables first and
then try to use dataset.ReadXML to load the data.

"Frank Uray" <Fr*******@discussions.microsoft.comwrote in message
news:A2**********************************@microsof t.com...
Hi all

I have problems loading XML data into SQL Server.
What is the best way to go ? I am new in using XML documents.
I have tried to do it with "Integration Services" and
also with "XmlTextReader", "XPathDocument", "DataSet.ReadXML" ...

None of this is working well because my XML document
has nested tables and in XML documents I dont see any
relations ...

Thanks for any comment .

Best regards
Frank

Here is what the XML looks like:

<?xml version="1.0" encoding="iso-8859-1" ?>
- <Test>
- <Transactions>
- <Trx>
<TrxCol1>false</TrxCol1>
<TrxCol2>SWAP</TrxCol2>
- <calendars>
<calendar>CHF</calendar>
</calendars>
- <legs>
- <leg>
<LegCol1>true</LegCol1>
- <calendars>
<calendar>JPY</calendar>
<calendar>GBP</calendar>
</calendars>
<LegCol2>false</LegCol2>
- <fixings>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-19</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-20</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-21</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-03-22</FixingCol2>
</fixing>
</fixings>
</leg>
</legs>
<nr>XY88.6</nr>
</Trx>
- <Trx>
<TrxCol1>true</TrxCol1>
<TrxCol2>BOND</TrxCol2>
- <calendars>
<calendar>EUR</calendar>
</calendars>
- <legs>
- <leg>
<LegCol1>true</LegCol1>
- <calendars>
<calendar>USD</calendar>
<calendar>GBP</calendar>
</calendars>
<LegCol2>false</LegCol2>
- <fixings>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-19</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-20</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-21</FixingCol2>
</fixing>
- <fixing>
<FixingCol1>0</FixingCol1>
<FixingCol2>2007-04-22</FixingCol2>
</fixing>
</fixings>
</leg>
</legs>
<nr>XY88.6</nr>
</Trx>
</Transactions>
</Test>


Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ben Long | last post by:
Hi All, A partner of mine has been charged with identifying a performance / load problem currently experienced on one of our websites. I'm thinking it may be a combination of HTML formatting...
1
by: Hazz | last post by:
I have 5 tables in SQL Server. Each with the following design and a sample chain of the relationships from the root (WRL - World) UUS is the 'Code' of the first table and it is the 'Parent' value...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
3
by: Eirik Eldorsen | last post by:
Im trying to make a nested repeater with 3 levels. I've successfully created a nested repeater with 2 levels, but when adding the 3rd level I get an InvalidCastException. What am I doing wrong? ...
1
by: Thu | last post by:
Hi, I create a Dataset to link three tables in my Access database. E.g. The three tables are , , . I then create 2 DataRelations, 1st relation (Order_Cust_Rel) links and using CustomerID field...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
2
by: Me LK | last post by:
I have a set of drop downs nested in a datagrid. Each drop down is a size or color for an item. Each row of the grid has a button which leads to a cart. When a user selects something from the...
39
by: Gilles Ganault | last post by:
Hello, I'm no LAMP expert, and a friend of mine is running a site which is a bit overloaded. Before upgrading, he'd like to make sure there's no easy way to improve efficiency. A couple of...
0
petepell
by: petepell | last post by:
Hello all, I am developing an application in VB 2008 that works with a SQL2005 DB to store and manipulate employee data. In one section of the app I want to be able to show a treeview of the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.