|
Home > Archive > MS SQL XML > October 2005 > XML bulk load does not work on tables with primary keys?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
XML bulk load does not work on tables with primary keys?
|
|
| guxu@hotmail.com 2005-10-27, 9:25 am |
| I realized that if I set the primary keys for the tables that I am
importing the XML data to, the XML bulk load does not work as it is
supposed to - in my case, only one table gets data and all others did
not get anything plus I get "The statement has been terminated" every
single time. Can anyone confirm if this is really true or not?
I removed the primary keys for the tables, and data was imported
correctly.
Here is what my XML looks like
<tag1> ...</tag1>
<tag2> ...</tag2>
<tag3 attr1=... >...</tag3>
<tag4 attr1=... >...</tag4>
<tag5 attr2=... >...</tag5>
<tag6 attr2=... >...</tag6>
....
<tagn>...</tagn>
tag3 and tag4 will go to a different table say table1, so are tag4 &
tag5, say table2. All the rest will go to the table say Main.
If I set the primary keys for 3 tables, I only get data imported to
Main. If I remove the key settings, all 3 tables get data.
Any clue why this is happening?
| |
| Bertan ARI [MSFT] 2005-10-27, 9:25 am |
| I am not sure I understand the case completely. Could you please provide the
Annoted XSD you have have generated to peform the bulkload?
Thanks.
--
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
<guxu@hotmail.com> wrote in message
news:1128367199.124831.267410@g47g2000cwa.googlegroups.com...
>I realized that if I set the primary keys for the tables that I am
> importing the XML data to, the XML bulk load does not work as it is
> supposed to - in my case, only one table gets data and all others did
> not get anything plus I get "The statement has been terminated" every
> single time. Can anyone confirm if this is really true or not?
> I removed the primary keys for the tables, and data was imported
> correctly.
>
> Here is what my XML looks like
> <tag1> ...</tag1>
> <tag2> ...</tag2>
> <tag3 attr1=... >...</tag3>
> <tag4 attr1=... >...</tag4>
> <tag5 attr2=... >...</tag5>
> <tag6 attr2=... >...</tag6>
> ...
> <tagn>...</tagn>
>
> tag3 and tag4 will go to a different table say table1, so are tag4 &
> tag5, say table2. All the rest will go to the table say Main.
>
> If I set the primary keys for 3 tables, I only get data imported to
> Main. If I remove the key settings, all 3 tables get data.
>
> Any clue why this is happening?
>
|
|
|
|
|