I’ve got a view that joins tables using a match on an xml node, like this example:
....CROSS APPLY xmlData.Nodes('/element/subElement')....
The problem is we now have elements called ‘element2’ and ‘element3’ which don’t get picked up. Is there a way to include these, almost using a LIKE on the nodes to pick these up as well?
Something along these lines:
....CROSS APPLY xmlData.Nodes('/element%/subElement')....
or is it a case of adding these extra nodes into the view manually?
Thanks
You can use an XQuery expression
Update
If you need to be more specific you can use
in theroy
starts-withwould be better thansubstringbut it does not work in SQL-server-2005 and I can’t test with SQL-server-2008