I want to insert the result set of this query into a temporary table inside my stored procedure.
select * from A
union all
select * from B
union all
select * from C
I want to insert the result set of this query into a temporary table inside my stored procedure.
select * from A
union all
select * from B
union all
select * from C
SELECT *
INTO #SomeTempTable
FROM (SELECT *
FROM A
UNION ALL
SELECT *
FROM B
UNION ALL
SELECT *
FROM C) D
Please try following:
Insert Into #Temp
select * from A
union all
select * from B
union all
select * from C