• I often recommend trying it with all the possible combinations of temp tables and table variable. In some cases I have been looking at CTE's. Wayne provides some really good guidance but unfortunately like many things in SQL, IT DEPENDS..

    Although it would be great to say this WILL perform better than that, in some cases using table variables will be faster in others slower, the same is true for temp tables. For big tables temp tables will most often be best, but not always..

    I have had a couple situations where mixing and matching worked best, but this was found by testing.. And in least one case seemed to be completely couterintuitive.

    CEWII