Metal Guitarist Forums banner

TSQL: Direct update an XML column

668 views 3 replies 2 participants last post by  Max 
#1 ·
So, i have myself a fancy table, and in said fancy table is a fancy column, which is an XML serialized object! OMFG! XML FTW! (not really. Fuck xml. Json ftmfw if were being real here)

I want to overwrite it. I know exactly the equivalent xml string. i write this in a query and it updates just fine, however i get MAHOOOSIVE OH FUCK XML ERROR COULD NOT DESERIALIZE OH SNAP errors. Ie, in one spot there is simply

Code:
<ChildrenStepIds>
     <int>4</int>
     <int>8</int>
</ChildrenStepIds>
I would like to, for example, change the second value to 7, so

Code:
<ChildrenStepIds>
     <int>4</int>
     <int>7</int>
</ChildrenStepIds>
When updating i maintain the same header info, ie
xmlns:xsi="crap" and that shit. When i update it updates fine and i can view it in the table fine, but deserializing blows the fuck up. Is there any way to do this, or am i stuck either coding up a test page/hardcoding values into the save function or doign it in dml?
 
See less See more
#3 ·
None whatsoever. At the point of deserialization, those ids are nothing but elements in a list of ints.

Even simpler changes ie a field <enabled>true</enabled> to false, or viceversa, breaks it. It seems to be an issue with assigning a string to the xml column? Im at a fucking loss here
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top