• wrote:

    However, that's true only when returning the entire XML value. The query() method retrieves a subset of untyped XML from the target XML instance.  location within the document, I would have received a violation error.

    Since the OP didn't explicitly use the query() method, please show us what you mean and why YOU would have received a "violation error".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)