您可以为临时表创建一个同义词(自SQL Server 2008起可用)。
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-synonym-transact-sql?view=sql-server-2017
例:
create table #test (test_id int, test_name nvarchar(64)) insert into #test (test_id, test_name) values (1, 'Jonn Doe') create synonym test for #test select * from test