asp123
asked on
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</itemnam e>
<itemtype>Text</itemtype>
</item>
<item>
<itemname>City</itemname>
<itemtype>Text</itemtype>
</item>
<item>
<itemname>State</itemname>
<itemtype>DropDown</itemty pe>
<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</quest iontype>
<questiontext>Please choose incentive option?</questiontext>
<questionoptions>
<questionoption>Cash</ques tionoption >
<questionoption>GiftCard</ questionop tion>
</questionoptions>
<questionlogic>If q3 selected then go to q4 else go to END<questionlogic>
</question>
</section>
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</itemnam
<itemtype>Text</itemtype>
</item>
<item>
<itemname>City</itemname>
<itemtype>Text</itemtype>
</item>
<item>
<itemname>State</itemname>
<itemtype>DropDown</itemty
<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</quest
<questiontext>Please choose incentive option?</questiontext>
<questionoptions>
<questionoption>Cash</ques
<questionoption>GiftCard</
</questionoptions>
<questionlogic>If q3 selected then go to q4 else go to END<questionlogic>
</question>
</section>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have a look in Books Online at OpenXML - let's you open a xml docs directly.
I gave some possible solution, unfortanly no response from asker.
I see 2 possible solutions:
- answered by me
- delete, no refund
I see 2 possible solutions:
- answered by me
- delete, no refund
Or maybe they used OPENXML