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.
This error message appears when you try to run a UNION, INTERSECT or EXCEPT query that has not an equal number of expressions in their SELECT list sections.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. All SELECT parts of a combined query using a UNION, INTERSECT, or EXCEPT operator must have an equal number of expressions.
All versions of SQL Server.
SELECT 1, 2
In the above example we try to combine two queries using a UNION ALL operator. Because each SELECT list has a different number of expressions, the error is raised.