updating xml schema collections

  • I am not sure how to update existing data in an xml field when we add elements and remove them. for example

    We need to remove "PT" from the schema. there is existing data out there that needs to be updated. How do I update the xml field to remove that portion. also say in the future we add an element how do I add the element?

    thanks

  • As per BOL as well as Jacob Sebastians great Book "The Art of XSD" there is no way to remove an element from a stored schema using T-SQL. The only way to alter the specific schema is to drop it an re-create it without the element in question. For details please see BOL, section "DDL for Managing XML Schema Collections in the Database".

    To add/modify/remove elements/attributes in question from existing XML data, please see BOL under "XML Data Modification Language (XML DML)".

    If you have trouble modifying the sample code to meet your requirements please show what you've done and what you're struggling with.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply