SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Conversion Fun


Conversion Fun

Author
Message
kevin.l.williams
kevin.l.williams
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3651 Visits: 1323
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.



Christian Buettner-167247
Christian Buettner-167247
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5337 Visits: 3889
That is actually a good question and unfortunately I have no idea Sad

Best Regards,

Chris Büttner
Darpan Sarin
Darpan Sarin
Old Hand
Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)

Group: General Forum Members
Points: 361 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...
SanDroid
SanDroid
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2448 Visits: 1046
"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?
Bhavesh_Patel
Bhavesh_Patel
SSC Eights!
SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)SSC Eights! (913 reputation)

Group: General Forum Members
Points: 913 Visits: 297
Yeap, I got it!



Bhavesh Patel

http://bhaveshgpatel.wordpress.com/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search