I have a XML column in database that may look like that ones:
<sql-connection-info name="myname" server="(local)\SQLEXPRESS" other-attribute="value" />
<oracle-connection-info name="othername" server="address" other-attribute="value" />
and so on. The names of nodes and attributes can be nearly anything. I need to iterate over the attribute/value pair on the first node. Every sample I have seen was for known node/attribute names.
When I tried to use
@xmlColumn.query("/@*")
I get this error
XQuery [query()]: Top-level attribute nodes are not supported.
Is this possible in TSQL? If yes how can I do this?
Result: