Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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 5, 2010 4:16 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 12:50 PM
Points: 305, Visits: 1,654
Comments posted to this topic are about the item IsNumber fails cast while IsBigInt passes cast
Post #916557
Posted Wednesday, June 2, 2010 10:17 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 14, 2016 2:44 PM
Points: 1,400, Visits: 103
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: Monday, June 27, 2016 8:37 AM
Points: 912, Visits: 2,656
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


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 12:50 PM
Points: 305, Visits: 1,654
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
Posted Thursday, May 19, 2016 6:52 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:26 AM
Points: 7,852, Visits: 758
Thanks for the interesting script.
Post #1787667
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse