I tried what was recomended on this thread:
Can I do a find/replace in t-sql?
UPDATE xmlTable SET xmlCol = REPLACE( CAST( xmlCol as varchar(max) ), '[search]', '[replace]')
So I tried it and it worked, sometimes. For example the following would work:
UPDATE TestSET xmlCol = REPLACE( CAST( xmlCol as varchar(max) ), 'Value', 'NewValue')
The following will NOT work:
UPDATE xmlTable SET xmlCol = REPLACE( CAST( xmlCol as varchar(max) ), 'Value', 'New Value')
(the space between new and value)
I get an error message:
Msg 9414, Level 16, State 1, Line 1 XML parsing: line 1, character 824, equal expected
I am not sure what to do, any ideas? I am trying to update any element that has attribute 'Value'