if (1=2) begin
IF OBJECT_ID('TEMPDB..#temp') is NOT null drop table #temp
select 1 as num into #temp
END
else BEGIN
IF OBJECT_ID('TEMPDB..#temp') is NOT null drop table #temp
select 2 as num into #temp
END
------
declare @SQL_ NVARCHAR(MAX)
IF OBJECT_ID('TEMPDB..#temp') is NOT null drop table #temp
if (1=2) begin
SET @SQL_='select 1 as num into #tempt'
END
else BEGIN
SET @SQL_='select 2 as num into #tempt'
END
EXEC (@SQL_)

--------------
