[dba-SQLServer]How to determine whether string is a number?

Billy Pang tuxedo_man at hotmail.com
Fri Oct 10 20:05:51 CDT 2003


I need to determine whether the string '4d4' is number or not. But it 
appears that the ISNUMERIC function is not always accurate as shown below:

SELECT ISNUMERIC(SUBSTRING('4D4',1,3));

It should evaluate to 0 but it returns 1! You can try for yourself.

Basically, I need a way to determine that '4D4' is not a number. Anyone have 
any ideas?

Thanks in advance,
Billy

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus



More information about the dba-SQLServer mailing list