Updating A CTE Which Based On Multiple Tables

  • I've read that when updating a CTE which is based on multiple tables, if the update affects just one

    of the tables which make up the CTE, then the update is possible but the result is not always guaranteed to be

    as you expect.

    If updating a table using a CTE which is based on multiple tables has this caveat,

    how does one know ahead of time which update will work and which one will not?

  • SQLUSERMAN (6/17/2016)


    I've read that when updating a CTE which is based on multiple tables, if the update affects just one

    of the tables which make up the CTE, then the update is possible but the result is not always guaranteed to be

    as you expect.

    If updating a table using a CTE which is based on multiple tables has this caveat,

    how does one know ahead of time which update will work and which one will not?

    Do you have a URL for where you read this to help clarify the context?

    --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)
    Intro to Tally Tables and Functions

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

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