• j-1064772 (7/22/2015)


    Was this really in the books on line ?

    There's not much detail on this in BOL. There's a paragraph with an example in the Limitations and Restrictions section of UPDATE.

    On the CTE article there's only a mention that a CTE can be followed by an insert, update, delete or merge.

    However, the rules are only explained for views. The best explanations on modifying data through CTEs come from blogs (or forums). That's a reason on why this feature is not widely known.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2