Difference between #temptable and ##TempTable?

后端 未结 6 1239
臣服心动
臣服心动 2020-12-02 16:16

What is the difference between #temptable and ##TempTable in SQL Server?

6条回答
  •  萌比男神i
    2020-12-02 17:09

    Local temporary tables are visible only to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after the user disconnects from the instance of SQL Server. Global temporary tables are visible to any user and any connection after they are created, and are deleted when all users that are referencing the table disconnect from the instance of SQL Server.

    Taken from here

    More on this

提交回复
热议问题