Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

IsNumber fails cast while IsBigInt passes cast Expand / Collapse
Author
Message
Posted Wednesday, May 05, 2010 4:16 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 12:05 PM
Points: 110, Visits: 719
Comments posted to this topic are about the item IsNumber fails cast while IsBigInt passes cast
Post #916557
Posted Wednesday, June 02, 2010 10:17 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 10:12 AM
Points: 883, Visits: 72
There is simpliest way to found non numeric symbols in string:
.....
if patindex('%[^0-9]%',@s)>0
set @value=0
....
Post #931488
Posted Friday, June 11, 2010 8:12 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 8:46 AM
Points: 845, Visits: 2,331
For character type strings you expect to be integers, there's also

ISNUMERIC(RTRIM(@value) + '.0e0')
Post #936053
Posted Friday, June 11, 2010 9:23 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 12:05 PM
Points: 110, Visits: 719
I think everyone is totally missing the point that the IsNumeric function succeeds on junk that will fail when you later do a cast. Do your suggestions handle the strange cases in the comments at the top of my IsBigInt function?
Post #936123
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse