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

Conversion Fun Expand / Collapse
Author
Message
Posted Monday, August 10, 2009 10:18 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, November 17, 2014 1:28 PM
Points: 3,189, Visits: 1,271
Christian Buettner (8/10/2009)

Hi Kevin,

I think that is not true.
Try
select isnumeric('$$')

for example.
It will evaluate to false, although this character ($) was no issue in your previous example.

The reason why your example is returning true, is probably the fact that it can be cast to (small)money.


My mistake. Thanks for pointing this out. I always thought this function just didn't work properly. Now I see I just didn't understand it's purpose. Any idea why Microsoft didn't implement ISMONEY() ISINT() or ISFLOAT()? ISNUMERIC() seems almost useless for testing before an insert.



Post #767982
Posted Tuesday, August 11, 2009 12:09 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
That is actually a good question and unfortunately I have no idea

Best Regards,
Chris Büttner
Post #768378
Posted Tuesday, August 11, 2009 1:13 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, August 18, 2009 3:23 AM
Points: 309, Visits: 58
ISNUMERIC() checks whether the input is valid numeric data, that also includes money data type, thats why it used to return 1 for isnumeric('0,.0') cause its a valid money type. On the other hand integer data type is limited to numbers only...
Post #768402
Posted Wednesday, August 12, 2009 12:09 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,228, Visits: 1,046
"Conversion failed when converting the varchar value '0,.0' to data type int."
No SQL product that I could find returned "error converting to a numeric" when trying to convert a varchar value to Int.

Why make the correct answer wrong?
Are you practicing up to write certification exam questions where the least wrong answer is the right one?

Post #769553
Posted Saturday, November 21, 2009 2:14 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, January 11, 2013 12:41 PM
Points: 621, Visits: 297
Yeap, I got it!



Bhavesh Patel

http://bhaveshgpatel.wordpress.com/
Post #822860
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse