If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Storing flexible XML File in MS SQL Database

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-09, 10:04
Carsten1981 Carsten1981 is offline
Registered User
 
Join Date: Jul 2009
Posts: 5
Storing flexible XML File in MS SQL Database

Hello,

i am currently developing a database to store a dynamic XML File. I dont have any experiences with that so I need a bit help.

My concept so far:

Table rootElement to store the firstElement of the file.

Table subElement to store the subElements of the rootElement

Table Item to store the values of the items and the name of the items (because the name of the Items can change daily) for the Elements

I am not sure if this is a good concept because the amount of data is high (million of records) and as far as i know searching in an non numeric field like name is not so fast.

Considering that many XML files contain the same combination of item name and item value i have changed the concept a bit.

Table rootElement to store the firstElement of the file.

Table subElement to store the subElements of the rootElement

Table Item to store the values of the item and the name of the items. But store only once a set of name and value

Table Element2Item which connects the Elements and Items

May this work faster as concept number 1 or is none of these concepts good for storing a dynamic XML file?

Thanks
Reply With Quote
  #2 (permalink)  
Old 07-04-09, 12:02
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,308
XML is a format for storing EAV, and as such doesn't fit well in any relational database. You can take unstructured data like a text or an XML file and force it into a structured store like SQL, but there isn't a good "fit" any way that I've seen.

Some databases incorporate an enhanced BLOB format specifically for coping with XML data. This is probably the best solution that I've seen for coping with XML within SQL.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 07-05-09, 07:07
Carsten1981 Carsten1981 is offline
Registered User
 
Join Date: Jul 2009
Posts: 5
Thx for your comment, i think a must run a few tests to find a good design.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On