SELECT ISNUMERIC('. ')
1
SELECT CAST('. ' AS [insert any numeric type])
Syntax error converting the varchar value '. ' to a column of data type
[insert any numeric type].
Any thoughts as to why SQL Server 7.0 considers '. ' to be numeric, yet can't
convert it to any numeric data type? The BOL even has this to say: "ISNUMERIC
returns 1 when the input expression evaluates to a valid integer, floating
point number, money or decimal type; otherwise it returns 0. A return value of
1 guarantees that expression can be converted to one of these numeric types."
An application that has worked for years, failed when a field of type CHAR(3)
(that should be an area code) contained a period only. I have error-checking
that tests ISNUMERIC on that field, and if it fails, alert accordingly. If it
passes, then convert it to a number, and compare it to acceptable ranges for
Area Code. (200 < AC < 999)
oops...