Groups | Blog | Home
all groups > dotnet xml > august 2005 >

dotnet xml : how would I store the XML



rviray
8/10/2005 9:03:38 PM

I am making multiple web service calls from a single ASPX page, th
return from those WS calls are XmlDataDocuments. I am trying to make
decision on where I should store the info (i.e., SQL, new xml file
stored on web server, in memory Session objects, State Bag, etc.)
really would like to store the info in SQL, but trying to figure ou
the best way... should I store the entire XML content into one fiel
(maybe a text field), or should I create various tables to hold th
info in a parent/child structure?

Anyone have any advise or insights would be appreciated?

Thanks

Ralp

--
rvira
-----------------------------------------------------------------------
rviray's Profile: http://www.msusenet.com/member.php?userid=421
View this thread: http://www.msusenet.com/t-187097303
n_o_s_p_a__m NO[at]SPAM mail.com
8/12/2005 7:08:31 AM
Trees and hierarchies in SQL are fairly complex when it comes to
inserting, updating and maintaining the integrity of the Xml. I
recommend against it, unless your data is purely relational, or you
have the time to invest in learning to do hierarchies correctly.

So, unless you are using SQL Server 2005, I recommend storing the Xml
in an ntext field (but validate it against your schema before storage).
You can always "shred" the xml later (into relational structures).

When you are ready for SQL 2005, use a column of type XML and add your
schema to a collection. This will offer data validation, indexing, and
other benefits not currently available.

Below are a few links on hierarchical data storage, in case you want to
go that route.

Trees in SQL: Nested Sets and Materialized Path
http://www.dbazine.com/oracle/or-articles/tropashko4

SQL Lessons
http://www.dbmsmag.com/9604d06.html

Maintaining Hierarchies
http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=8826&Display...


Manipulating Hierarchies with UDFs
http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=16123&Displa...


Trees and Hierarchies in SQL
http://www.amazon.com/exec/obidos/tg/detail/-/1558609202/qid=11237899...


p.s.: You might get even better responses by posting to:
microsoft.public.sqlserver.programming

-KJ
AddThis Social Bookmark Button