SQL Server tables: what is the difference between @, # and ##?

前端 未结 6 1302
北恋
北恋 2020-11-29 20:22

In SQL Server, what is the difference between a @ table, a # table and a ## table?

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 20:54

    # and ## tables are actual tables represented in the temp database. These tables can have indexes and statistics, and can be accessed across sprocs in a session (in the case of a global temp table, it is available across sessions).

    The @table is a table variable.

    For more: http://www.sqlteam.com/article/temporary-tables

提交回复
热议问题