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

前端 未结 6 1240
北恋
北恋 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:41

    CREATE TABLE #t
    

    Creates a table that is only visible on and during that CONNECTION the same user who creates another connection will not be able to see table #t from the other connection.

    CREATE TABLE ##t
    

    Creates a temporary table visible to other connections. But the table is dropped when the creating connection is ended.

提交回复
热议问题