I wanted to add one table below another one in SQL Server.
This is my code:
CREATE TABLE #main_table
( Scenarios float ,Attribute VARCHAR(50) ,Value float );
insert INTO #main_table
select *
FROM
( SELECT *
FROM #table1
UNION ALL
SELECT *
FROM #table2) a
But I get an error:
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists
Anyone would know what may be the issue?