Hugo Kornelis (4/8/2013)
kapil_kk (4/8/2013)
For the first part I understand the behavior but am still confused with the SELECT ISNUMERIC('.+') -- Returns 0 behavior 🙁The . actually represents 0.0, with leading and trailing zero omitted.
So +. is equivalent to +0.0, which is a valid number. But .+ is equivalent to 0.0+, which is not. The plus sign (just as the minus sign) is only valid at the start of the numeric string.
I am again surprised with these two statements behavior:
SELECT ISNUMERIC('.,') -- Return 1
SELECT ISNUMERIC(',.') -- Return 1
The comma is used as the thousands seperator in America (and, as far as I know, most English speaking countries). When converting from string to money and smallmoney, thousands seperators in the string are accepted. This is implemented in a rather loose way - there is no checkk if the thousands seperators are where they should be, they are simply ignored.
Thanks Hugo, now its clear to me :-):-)
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/