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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Import XML to table

Author  Topic 

NickyJ
Starting Member

46 Posts

Posted - 2005-08-23 : 12:07:03
I have the follwoing XML.

<mail email_1="myemail@1.com" email_2="myemail@2.com" email_3="myemail@3.com" email_4="myemail@4.com" >
<jobs>5022</jobs>
<jobs>2438</jobs>
<jobs>3081</jobs>
<jobs>4654</jobs>
<jobs>3899</jobs>
</mail>

However this could change as email1 could go up to say 15 (email_15) and Jobs could go to say 100 (current example only 5)

I am trying to use OPENXML to import into a table however I am unsure as to how to do it due to the Email_1 increasing ?? Anyone help ??

Hope all is clear.

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2005-08-23 : 12:45:16
Hi
You need to change your XML schema along these lines:
<emails>
<email>myemail@1.com</email>
<email>myemail@2.com</email>
</emails>


Mark
Go to Top of Page
   

- Advertisement -