• GilaMonster (10/12/2015)


    nadersam (10/12/2015)


    GilaMonster (10/12/2015)


    Jeff suggested temp tables. Be careful with table variables, because they don't have statistics, the row estimations are miles off usually and they can (and do) result in really bad performance.

    I recently got a procedure from 30seconds to about 15ms just by replacing a table variable with a temp table.

    Test carefully.

    About the timing do you mean the contrary?

    No, I mean precisely what I said.

    So in your case the temp tables is better than table variables?

    Maybe you missed the earlier part of my statement:

    Be careful with table variables, because they don't have statistics, the row estimations are miles off usually and they can (and do) result in really bad performance.

    Thanks Gila