I have a column that stores xml using SQL Server’s Xml data type. Also, I have an Xpath query that can select the single node from the xml that I am wanting to remove. So, my question is, is there a way to select all of the xml in the column EXCEPT the single specific node I’m needing to remove? I can select the node I want to remove, but I can’t find a way to remove it from the rest of the xml and leave all the rest intact. If anyone could give me any guidance on how to do this using SQL Server Xml function, it would be greatly appreciated.
Share
You can do it like this:
So, you need to put the value into an XML variable and use modify to delete the node, giving the appropriate XPath for the node to remove.