1. Transaction logs are not recorded for the table variables.
2. A procedure having temporary table is not pre-compiled, while an execution plan of procedures with table variables can be statically compiled in advance.
3. Table variables exist only in the same scope as variables.
Differencing to the temporary tables, they are not visible in inner stored procedures and in exec(string) statements. Also, they cannot be used in an insert/exec statement.
Asked In: Many Interviews |