There is a table called TABLEA that has a varchar(255) field called FIELD1 which contains numeric and alphanumeric values. I have created a view called TEST_VIEW that references the TABLE_A, converts the FIELD1 to an int and the where clause makes sure only integer values are returned.
SELECT CAST(Field1 AS int) AS Field1, Field2, Field3
WHERE isnumeric(Field1) = 1
The TEST_VIEW works when I do a select *, but if I introduce a WHERE clause using the Field1. I get an error message.
Additional Info: This error is only reproduced when an Index is defined with the Field1, i.e. when I remove the index the query works.