• The article is really nice, but its very important to consider the performance before using a table variables, temp tables, or CTE's.

    In terms of performance I think we should avoid using a temp table both in a stand alone query or in a SP, as the SQL optimizer can't reuse the execution plan for a query/sp with a temp table. It creates a new execution plan each time we reexecute the query/SP. In case of a large SP using a code block with a temp table is very much prone to face a performance drawback because the SQL optimizer is unable to reuse the execution plan each time we reexecute the SP with changed input parameters.

    However we use tablevariable or CTE for the same requirement which doesn't hamper the performance.