0

I have a table called student.

Table Student( Name varchar() ,subject xml)

I have some values in my data database. Now i have a requirement to append the xml data.

<subject code="Maths">
  <subjectname name="test">test123</subjectname>
</subject>

i want to add a new value to the existing xml.

<subjectname name="newtest">newtest123</subjectname>

this will be the sample value. Any one have any idea or way to approach the problem any work around on the same.

1 Answer 1

1

update Student set subject.modify('insert <subjectname name="newtest">newtest123</subjectname> as last into /Maths[1]') where name='YourName';

Dird

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.