I am trying to run this query but I am getting this error:
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.
What am I doing wrong here? Please help.
SELECT *
into #xx
From (
Select *
FROM #x
union all
select * from MartDB.DBO.BAW_AllSources_Stage1
) AAAsds
Your inner query part
Select *
FROM #x
union all
select *
from MartDB.DBO.BAW_AllSources_Stage1
has * in both queries participating in UNION.
Check and see if the both *s translate into same number of columns and data type in order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With