Stairway to XML: Level 6 - Inserting Data into an XML Instance

  • Rob Sheldon

    SSC Veteran

    Points: 278

    Comments posted to this topic are about the item Stairway to XML: Level 6 - Inserting Data into an XML Instance

  • james.ingram

    SSC Journeyman

    Points: 85

    Thanks for a great sequence, Rob! I had no idea this capability was in SQL until a fellow programmer pointed out to me. My question: I realize that a series like this uses simplistic examples out of necessity, but it seems like querying and modifying XML data relies a lot on prior knowledge of the XML content. For instance, whether or not to use "as first"/"as last" depends on whether any children exist in the node in the first place. If "as first" is used, and there are no children in the node, does it break execution? It seems to me that in practice it would be much more common to add books to the booklist "as last" whether there are any extant books in the list or not, especially if developing a stored proc that receives the Person id as a parameter. Or is it necessary to do querying first to determine the number of books already in the list, and then code two methods, one with "as last" and one without "as last"?

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

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