difference | Table Variable | Temp Table | CTE |
---|---|---|---|
bound | batch bound | session bound | 1 statement |
ddl | no | yes | no |
syntx | declare | create # | with cte as |
dml | yes | yes | |
recursive | no | no | no |
reference table | no | no | yes(can delete duplicate record) |
store | Tempdb database but not the memory | tempdb | in memory |
index | yes | yes | no |
网友评论