When I select from a view, I get an error:
Error converting data type varchar to float.
Query:
select cast(myNumVal as float) myFloatVal
from uvw_myView
When I execute it this, however, it works, no errors
select
cast(myNumVal as float) myFloatVal,
CASE
WHEN ISNUMERIC(myNumVal + 'e0') = 0 THEN myNumVal
ELSE null
END AS MyVarchar
from uvw_myView
The two queries are identical, with the exception of the additional column in the latter. Can somebody explain why this is happening?