Session-global temporary tables in SQL Server

后端 未结 4 2021
無奈伤痛
無奈伤痛 2021-01-16 15:31

In SQL Server, temporary tables with a name like #temp has a local scope. If you create them in your session, everything in your session can see them, but not outside your s

4条回答
  •  粉色の甜心
    2021-01-16 16:23

    i dont think theres an out of the box solution in SQL server for what you require. i think the only way is to mange it yourself. is it acceptable to you create a normal table with some suffix instead of using the blobal table (where you have contorl over its full name)? since the global tables go to the tempdb, this will also help you isolate data to your database as a side effect.

提交回复
热议问题