SQL SERVER - UDF - Validate Integer Function(blog.sqlauthority.com)
submitted by
pinaldave(9662) 4 years, 9 months ago
I received quite a good feedback about my post about SQL SERVER - Validate Field For DATE datatype using function ISDATE()
One of the most interesting comment I received from my reader from Canada. I was suggested just like ISDATE() to write about ISNUMERIC() which can be used to validate numeric values.
As per BOL:
ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0. ISNUMERIC returns 1 for some characters that are not numbers, such as plus (+), minus (-), and valid currency symbols such as the dollar sign ($).
Now this is issue with ISNUMERIC() function. It even suggest variable as numeric when it is not. I use following function to validate instead of ISNUMERIC() to validate if number is numeric or not.
|category: Database
|Views: 34
tags:
SQL SQLAuthority pinaldave Database SQLServer another
Everyones tags:
Your Tags: