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

Stuart McLachlan stuart at lexacorp.com.pg
Fri Oct 10 22:41:17 CDT 2003


On 11 Oct 2003 at 1:05, Billy Pang wrote:

> 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?
> 
Unfortunately, xxDx is exactly the same as xxEx. It is regarded as 
scientific notation 

i.e. 4D4 = 40000, 1.234D5 = 123400  etc




 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the dba-SQLServer mailing list