Steve Jones - Editor (5/5/2008)
That is not a compilation error. It's a run-time error when a conversion occurs. There are very few compilation errors, mostly syntax issues.
In my humble opinion the answer
The varchar is converted in int (error results)
should have been
The varchar is not converted into int (run time error results)
Since this union statement will work (no run time error)
select '10'
Union
Select 4
and this will compile
CREATE PROCEDURE Dbo.Oops
AS
select 'B'
Union
Select 4
but will result in the run time error when invoked.
Oh well looking back now .... I have gained knowledge from the QOD and that is its objective.
Thanks Steve for making think even more