Hey Guys,
Consider this entity:
DEVICE contains
Device Name, Bus Type, Installation Date, etc...
and a composite attribute (DEVICE_FILES)
FileID, FilePath
1 DEVICE -> Many DEVICE_FILES
what should i use in such scenario with SQL 2K5 (Actually not pretty sure i should post this question here, if no tell me where plz)
What to use ?
1. Two Tables (1->M Relation)
2. XML column contains the DEVICE_FILES in the DEVICES table ?
The question is repeated if it's 1->1 Relation (what should i use?)
It's just a descussion (someone told me USE TABLES NO XML) & he's a really good guy, got some books of his own. So if he's right then why ? if he's wrong then Why ?
Thanks
-
-
Right, Wrong? No.
the "right answer" is "It Depends"
for example:
if you are going to manage data on say hundreds of computers in a data center then a sql db might be the "right thing".
if on the other hand you are packaging some info for one computer or one device to say install it.... then XML might be the better way to do it.
sometimes a hybird is best, like a db with a row that includes an xml column to store part of the data. possibly there to allow you to generate an xml file that lists data for several devices on the fly.
the "right answer" is often found by what you need to do with the data.... only in afew cases is there any really absolute single right answer. -
figuerres wrote:Right, Wrong? No.
the "right answer" is "It Depends"
for example:
if you are going to manage data on say hundreds of computers in a data center then a sql db might be the "right thing".
if on the other hand you are packaging some info for one computer or one device to say install it.... then XML might be the better way to do it.
sometimes a hybird is best, like a db with a row that includes an xml column to store part of the data. possibly there to allow you to generate an xml file that lists data for several devices on the fly.
the "right answer" is often found by what you need to do with the data.... only in afew cases is there any really absolute single right answer.
No, that's not what i meant
.. i mean to use 2 related DB tables DEIVICES & DEVICES_FILES ... or add the devices files as XML COLUMN in DEVICES TABLE.. not XML FILE
-
XML will be slower, harder to query and far harder to write reports against. There are situations where you'd use an xml column, but this really isn't one of them!
-
thepuffin wrote:XML will be slower, harder to query and far harder to write reports against. There are situations where you'd use an xml column, but this really isn't one of them!
When should you use the XML columns then ? -
XML shouldn't be used for storing relational data. What XML is good at, is storing hierarchical data. That's why I don't like to serialize a DataTable as XML. XML is not a good format for storing tabular data.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.