Reputation: 1913
How to add second condition to the following query?
SELECT c.value('@tray','VARCHAR(MAX)')
FROM @L_XML.nodes('/XDOC/DOC[@TYPE="Q"]') T(c)
so that I could filter on attribute: type = Q or S?
Where Can I find a detailed manual about xml nodes?
Upvotes: 2
Views: 3044
Reputation: 138980
SELECT c.value('@tray','VARCHAR(MAX)')
FROM @L_XML.nodes('/XDOC/DOC[@TYPE = ("Q", "S")]') T(c)
Upvotes: 4
Reputation: 5265
A very good starting point is SQLXML where an exhaustive list of basic reads and writes are covered on a How To basis. Quite handy and certainly worth a bookmark in my book!
In regard to your first question: have a look here, that might give you what you're looking for. I think your problem might be in the quotes.
Upvotes: 1