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 ««12

ISNUMERIC() and REPLICATE() Expand / Collapse
Author
Message
Posted Tuesday, November 24, 2009 7:08 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:03 PM
Points: 782, Visits: 730
dun (11/24/2009)
That's a big number. How do you report that on your financials? Numbers represented in $000,000,...,000,000?

It made me do a search on the net for big number names (see http://www.sizes.com/numbers/big_numName.htm). It was interesting to find that the number 1 billion can mean something different in other countries. Fantastic.


You have now ruined my morning ... HAHA ... i am doing the same.
Post #823855
Posted Tuesday, November 24, 2009 7:16 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, March 18, 2013 7:52 PM
Points: 280, Visits: 88
Not an every day problem for us (hi from France ^^ ), but as we have to communicate in english for international, it is an usual question :D


My MCP Transcript (ID : 692471 Access : 109741229)
Post #823860
Posted Tuesday, November 24, 2009 7:16 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, August 28, 2014 1:37 PM
Points: 2,677, Visits: 215
Any number of zeros returns 1. So if it is smart enough to know that all the characters are zero and thus must be a number why can't it just check all the characters individually to see if they are 0 to 9? Or is there no such thing as a number larger than a float's maximum value? I just now noticed that it strips away all leading zeros. I guess that answers my own question.

SELECT ISNUMERIC(REPLICATE('0', 7690) + REPLICATE('1', 310)) returns 0

SELECT ISNUMERIC(REPLICATE('0', 7691) + REPLICATE('1', 310)) returns 1

The reason then that the second one returns 1 is that there are really only 309 of them. It only considers the first 8000 characters of the string, meaning there are really only 309 of the digit 1, which we already know returns a 1.
Post #823861
Posted Tuesday, November 24, 2009 7:17 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:03 PM
Points: 782, Visits: 730
crussell-931424 (11/24/2009)
Any number of zeros returns 1. So if it is smart enough to know that all the characters are zero and thus must be a number why can't it just check all the characters individually to see if they are 0 to 9? Or is there no such thing as a number larger than a float's maximum value? I just now noticed that it strips away all leading zeros. I guess that answers my own question.

SELECT ISNUMERIC(REPLICATE('0', 7690) + REPLICATE('1', 310)) returns 0

SELECT ISNUMERIC(REPLICATE('0', 7691) + REPLICATE('1', 310)) returns 1

The reason then that the second one returns 1 is that there are really only 309 of them. It only considers the first 8000 characters of the string, meaning there are really only 309 of the digit 1, which we already know returns a 1.


i agree 0= 000 but 1 <> 111
Post #823862
Posted Tuesday, November 24, 2009 8:03 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 8:53 PM
Points: 33,204, Visits: 15,353
It's a bug in the engine, and I'm not sure how many people will run across it, but it might be nice to know this.

The explanation has been changed.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #823904
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse