Extracting XML data to columns during query

Tech-Archive recommends: Fix windows errors by optimizing your registry



I'm working with an inherited SQL 2000 database (now moved to 2005)
that stores strings of XML in a text column. I'd like to avoid
changing the schema right now. Each row's XML data looks something
like:

<root><element id='5' name='bob' message='hello' /></root>

The exact attributes in the inner element are unknown, but what I
would like to be able to do is return them as columns in a query such
that I would get:

id name message
------- -------------- --------------
5 bob hello



Any thoughts?

.


Quantcast