• KoldCoffee (5/1/2013)


    please don't take the sample scripts to literally. They are over simplified, so my question is still... how to combine the results of two scripts sharing identical columns, each made up of several CTEs (as posted above)? I am not trying to UNION ALL two ctes but rather two sets of CTEs.

    The easiest way would be to use a SELECT...INTO... for each set of CTEs and then UNION your temp tables.

    Otherwise, it's hard to give a good answer without all the details.

    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