Is it possible to use an XML DML statement to rename an element in an untyped XML column?
I am in the process of updating an XML Schema Collection on an XML column and need to patch the existing XML instances by renaming one element before I can apply the latest schema.
As far as I can tell from the docs you can only insert / delete nodes or replace their value.
As the saying goes, "Where there's a will there's a way"
Here's two methods: the first is to simply replace the previous xml with a new xml constructed from the original with the new element name. In my example I've changed Legs/Leg to Limbs/Limb this could get very complicated for anything but the simplest schema
And secondly, a more appropriate approach of combining insert and delete.
I've combined them into one simple example: