Store XML in database - newbie question

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I'm not sure which group to post this in, so forgive me if I post to a few,
hoping that someone can point me in the right direction.

In a .NET project (probably ASP.NET but could also be rich client), I want
to save some XML data to a database (sql-server but could also be Oracle).
How can I do this ? I certainly cant see XmlDocument as a type available for
columns in a database table, but perhaps it could be converted to/from a
Binary or Text column ?
 
If you are using Oracle you can define a column as an XMLType this will allow
you store and retrieve the XML as a column. In order to utilise this it is
necessary to download an addition ODP toolkit from Oracle to access it in
..Net. There is also the possibilty of storing the XML as part of the
relational database within Oracle although I haven't used that option yet.
 
In SQL Server 2000, you can:

1. shred it into relations easily either using a mapping schema or OpenXML.
Works best for structured data.
2. Store it as IMAGE or NTEXT (preserves the original form). Need to check
for XML well-formedness on midtier before.

In SQL Server 2005, you can use an XML datatype.

Best regards
Michael
 
Back
Top