Re: how to modify an xml field that may be plain text

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm not sure what you're asking. The update statement in a stored procedure and is actually designed to update any or all fields in the table.

EX:
update mytable
set field1 = coalesce(@field1, field1),
field2 = coalesce(@field2, field2),
....
where pkfield = @pkvalue


So in this construction it's difficult to update a field like this. In the case where the field is not using multiple types to identify different values of this field it would just use a normal field update syntax (i.e. field1 = @field1) however if the field is a xml fragment then it would need to be updated using the xml datatype's modify() DML method. It doesn't appear that there is any way to do an either-or type of update.







Michael Rys [MSFT] wrote:
What are the conditions for the value?

Thanks
Michael

"APA" <buddy__a@xxxxxxxxxxx> wrote in message news:OTVYmpxTHHA.4956@xxxxxxxxxxxxxxxxxxxxxxx
I have a field that is of xml datatype. The problem is that there are cases where the field is not an xml fragment but just a string.

Could be this:

<root>
<node type="1">sofsfnsdnfo</node>
<node type="2">ovhosdnosndv</node>
<node type="3">iudhviuvibeuw</node>
</root>

or it could just be this 'blah blah blah'.



So when updating this field it might need to update just one of the nodes or the entire field (in the case where it's a simple string).

Is there a way to handle both update types in one update statement?


Thx.



.



Relevant Pages

  • Re: how to modify an xml field that may be plain text
    ... Could you please provide the before and the after state of your database for ... cases where the field is not an xml fragment but just a string. ... or it could just be this 'blah blah blah'. ... nodes or the entire field (in the case where it's a simple string). ...
    (microsoft.public.sqlserver.xml)
  • Re: how to modify an xml field that may be plain text
    ... cases where the field is not an xml fragment but just a string. ... or it could just be this 'blah blah blah'. ...
    (microsoft.public.sqlserver.xml)
  • how to modify an xml field that may be plain text
    ... I have a field that is of xml datatype. ... The problem is that there are cases where the field is not an xml fragment but just a string. ... or it could just be this 'blah blah blah'. ... So when updating this field it might need to update just one of the nodes or the entire field (in the case where it's a simple string). ...
    (microsoft.public.sqlserver.xml)
  • Re: Error message on assignment line before rs.update
    ... TenderType as string ... as to what an Update statement would look like based on the Query. ...
    (microsoft.public.vb.database.ado)
  • Re: Forms and ODBC connections
    ... Thank you for your answer but it isn't clear to me the sintax you are using ... for the connection string and the update statement. ... > and the connection string mirrored that of my linked tables. ...
    (microsoft.public.access.formscoding)