Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vishakha
Starting Member
40 Posts |
Posted - 2007-01-31 : 01:53:50
|
| I have xml in the following format<root><header><elements><element><name></name><date></date><id1></id1> <child element1> <id2></id2> <date></date> <sequence></sequence> <grand child loop> <grand child1> <id3></id3> <age></age> <number></number> <grand grand child1 loop> <grand grand child1></grand grand child1> </grand grand child1 loop> <grand grand child2 loop> <grand grand child2></grand grand child2> </grand grand child2 loop> </grand child> </grand child loop> </child element1> <child element2></element><element></element>...</elements><trailer></root>Element level can have 2 nodes, of which one can be null.The elements inside the loop can occur multiple times. Each loop has an identifier.Now we have defined our tables in a way that there is a parent-child relationship between nodes and subnodes.If I don't create any primary and foreign keys the bulk load works fine. But in case there is no data for any of the nodes then nulls are inserted which is not desirable. I would like to avoid that.Also that makes the select slow after the insert.Secondly I would like denormalize the table and add some of column mainly ids of the parent tables in child table to make select faster. Is there a way to define the mapping in xsd file to accomplish this. |
|
|
Vishakha
Starting Member
40 Posts |
Posted - 2007-01-31 : 02:00:38
|
| Forgot to mention one more thingIf my primary key is of 3 columns and of that 2 are foreign keys how to update it using xml bulk load mapping schema. |
 |
|
|
|
|
|