解决方法
本地临时表
Local temp tables are only available to the current connection for the
user; and they are automatically deleted when the user disconnects
from instances. Local temporary table name is stared with hash (“#”)
sign.
例:
CREATE TABLE #LocalTempTable( UserID int,UserName varchar(50),UserAddress varchar(150))
本地临时表的范围仅与当前用户的当前连接相关.
全球临时表
Global Temporary tables name starts with a double hash (“##”). Once
this table has been created by a connection,like a permanent table it
is then available to any user by any connection. It can only be
deleted once all connections have been closed.
例:
CREATE TABLE ##NewGlobalTempTable( UserID int,UserAddress varchar(150))