Loading XML Document in SQL Server 2000

I have a XML Document which is structured like below and will need to load the data into SQL Server 2000. Here the <QuestionType>, <item> and nodes under <item> are optional.

Is there a way this could be loaded into SQL Server directly?

If I choose loading it reading it node by node in C# in .NET, Can someone point to some example code?

Greatly appreciate any advice and help on this!

<section>
<question>
<questionid>q1</questionid>
<questiontext>What is your name?</questiontext>
<questionlogic>If q1 not empty then go to q2 else go to END<questionlogic>
</question>
<question>
<questionid>q2</questionid>
<questiontext>What is your mailing address?</questiontext>
<questionlogic>If address provided  then go to q3 else go to END<questionlogic>
<item>
<itemname>Address</itemname>
<itemtype>Text</itemtype>
</item>
<item>
<itemname>City</itemname>
<itemtype>Text</itemtype>
</item>
<item>
<itemname>State</itemname>
<itemtype>DropDown</itemtype>
<options>
<option>NY</option>
<option>VA</option>
<option>DC</option>
</options>
</item>
<item>
<itemname>Zip</itemname>
<itemtype>Text</itemtype>
</item>
</question>
<question>
<questionid>q3</questionid>
<questiontype>Radio</questiontype>
<questiontext>Please choose incentive option?</questiontext>
<questionoptions>
<questionoption>Cash</questionoption>
<questionoption>GiftCard</questionoption>
</questionoptions>
<questionlogic>If q3 selected then go to q4 else go to END<questionlogic>
</question>

</section>
asp123Asked:
Who is Participating?
 
DhaestCommented:
Do you want to do it through c#-coding or do you want to perform it directly on sql2000 ?


http://www.databasejournal.com/features/mssql/article.php/10894_2235451_2


In SQL Server 2000, you will have to open the file on the mid-tier and pass
the content to the stored proc as a parameter (via ADO, OLEDB, ADO.Net etc).

In SQL Server 2005, you can use OpenROWSET (BULK ).
0
 
twoboatsCommented:
Have a look in Books Online at OpenXML - let's you open a xml docs directly.
0
 
DhaestCommented:
I gave some possible solution, unfortanly no response from asker.
I see 2 possible solutions:
- answered by me
- delete, no refund
0
 
twoboatsCommented:
Or maybe they used OPENXML
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.