[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

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>
0
asp123
Asked:
asp123
  • 2
  • 2
1 Solution
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now