为什么你不能这样做,是否有解决方法?SQL Server 2005错误
你得到这个错误。
Msg 2714,Level 16,State 1,Line 13 数据库中已经有一个名为'#temptable'的对象。
declare @x int
set @x = 1
if (@x = 0)
begin
select 1 as Value into #temptable
end
else
begin
select 2 as Value into #temptable
end
select * from #temptable
drop table #temptable