Click here to Skip to main content
11,412,516 members (73,949 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server-2008
HI,

select ISNUMERIC('149972,')
 
out put:
1
 
select ISNUMERIC('149972=')

out put:
0

here in first out put it show 1 and second out put it show 0

is it , is also include in int or not

Thanks
ramesh.m
Posted 18-Nov-12 23:39pm
Edited 18-Nov-12 23:40pm
v2
Comments
Milind Thakkar at 19-Nov-12 5:33am
   
Does the explanation below answers your question?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

According to definition on MSDN: "ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type. Valid numeric data types include the following:
int, numeric, bigint, money, smallint, smallmoney, tinyint, float, decimal, real"

Comma is allowed in Money, hence it is returning 1. It will also return 1 if you +, - £ etc signs in the input.

http://msdn.microsoft.com/en-us/library/ms186272.aspx[^]

Hope that helps. If it does, mark it as answer/upvote.
Thanks
Milind
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0.
The '=' in the expression makes it a invalid numeric.
  Permalink  
Comments
ramesh4128 at 19-Nov-12 4:53am
   
Please let me know the reason why this special character',' is only accepted as numeric. I tried with all special characters and returned as non-numeric except ','.

Thanks in advance.
Milind Thakkar at 19-Nov-12 5:00am
   
Check details provided in my solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 414
1 Sascha Lefévre 200
2 Maciej Los 155
3 ProgramFOX 130
4 Sergey Alexandrovich Kryukov 110
0 Sergey Alexandrovich Kryukov 9,025
1 OriginalGriff 7,247
2 Maciej Los 3,525
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150427.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100