0

Please look at below sample

SELECT ISNUMERIC('12D54') AS RETURN_VAL_1
SELECT ISNUMERIC('12054') AS RETURN_VAL_2

It is return 1 for both RETURN_VAL_1 and RETURN_VAL_2. (It means both strings detect as numeric values) But actually 12D54 is not numeric. I want to check a column which having only numbers. try_parse can be used in SQL Server 2012. It is nice solution for me and worked fine. But now I'm using SQL Server 2008 and it is refused "try_parse".

So how to solve my problem?

weeraa
  • 1,123
  • 8
  • 23
  • 40
  • `12D54` is numeric - it can be converted to a `float`. And that's the problem with `ISNUMERIC` - it answers the question no-one wants to ask - "can this string be converted to *any* of the numeric data types? - I don't care which ones, and don't bother to tell me" – Damien_The_Unbeliever Sep 22 '15 at 08:19
  • Thanks for the reply. Yap. In brief I need to extract the field value, which having only numbers. (My scenario is, if the field has only number, it pass to some other table and otherwise pass as null) How to do this? – weeraa Sep 22 '15 at 08:57

0 Answers0