As a follow-up to this question - Is there a way to get the raw XML inside an element that you select using OPENXML? Should I be using an XML datatype instead? Is there a way to get the raw XML with the XML datatype?
+2
A:
Well, with the XML datatype in SQL Server 2005 and up, you always HAVE your raw XML - no need to "get it" - it's right there, in the column, stored for your convenience.
You can of course also query it using XQuery and XPath, and even update it while it's stored inside the database!
If you can - definitely use the XML data type! You can use it "untyped" or associate it with a XML schema to add validation.
Marc
marc_s
2009-04-02 21:09:08