Error:
Msg 205, Level 16, State 1, Line 1
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.
Reason:
The select statements in the clause do not have the same number of columns.
Fix:
Make sure that all the starements using UNION, INTERSECT or EXCEPT operator have same number of expressions(columns).
Use column names instead of using * in the select list.
Sample example code
Before:
SELECT 1 UNION SELECT 2,3
After:
SELECT 1,NULL UNION SELECT 2,3