Hello,Apologies, I'm sure this is probably straight-forward, but my TSQL XML knowledge is a little shaky.I am trying to find all the elements called "Comment" from an XML column in a database for a particular row. The comment elements can appear (nearly) anywhere in the XML, however I need to get all of them to check if they contain certain keywords (like 'URGENT'). This is what I've come up with so far:SELECTISNULL(SOME_XML.value('(//*[local-name()="Comment"])[1]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[2]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[3]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[4]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[5]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[6]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[7]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])
','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[9]','varchar(255)'),'') +ISNULL(SOME_XML.value('(//*[local-name()="Comment"])[10]','varchar(255)'),'')FROM SOME_TABLE_WITH_XMLWHERE ID=1234567891011(the eightball above should be [_8_] without underscores ;) )Although this is ugly, it gives a result I can use, provided there are less than 10 comments in the XML (possibly a reasonable assumption). But can I return all of the comment fields, regardless of how many there are? There is no requirement that the result strings have to be added together like this, I can also use a result set with the comments seperate rows.Any help given would be very much apprecieated. Thanks!