ISNUMERIC
The ISNUMERIC function determines whether an expression evaluates to a valid numeric type, returning 1 if it is valid and 0 if it is not valid.
Syntax
ISNUMERIC (expression)
Remarks
The following table lists the data types of the evaluated expression for ISNUMERIC and the possible return values.
Data Type of Evaluated Expression | Returns |
BIGINT, INT, SMALLINT, TINYINT, BIT, DECIMAL, NUMERIC, FLOAT, REAL, MONEY, SMALLMONEY | 1 |
Any other data type | 0 |
Example
SELECT Contact, Phone, ZipCode
WHERE ISNUMERIC (ZipCode) = 1
FROM /shared/examples/ds_orders/products products
The above example returns the rows with zip code having valid numeric values.
Note: ISNUMERIC returns 1 for some characters that are not numbers, such as plus (+), minus (-), and valid currency symbols such as the dollar sign ($).