Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Why IsNumeric work like this?

Author  Topic 

karthickbabu
Posting Yak Master

151 Posts

Posted - 2008-09-06 : 06:25:55
I want to check Phone No's is Numeric or not. So i try to write the code to check for Numeric, In case it contains special characters (/) it shows IsNumeric ZERO. But if contain , in phone nos it doesn't shows Numeric FALSE.

SELECT ISNUMERIC('4357952,34678965') - it returns 1

SELECT ISNUMERIC('43257952,34678965') - it returns 0

If the length of first phone no below 8 character it shows IsNumeric TRUE.

Can any one know why it work like this?...



================================================

When you realize you've made a mistake, take immediate steps to correct it.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-06 : 06:33:55
If you want to check if phone no has only numbers, use

where phone_no not like '%[^0-9]%'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -