Login     Register

        Contact Us     Search

XLeratorDB/strings Online Documentation

SQL Server ISNUMERIC function


ISNUMERIC

Updated: 30 April 2009

Use ISNUMERIC to determine if a value is numeric.
 Syntax
SELECT [wctString].[wct].[ISNUMERIC] (
   <@Text, nvarchar(4000),>)
Arguments
@Text
is the text to be evaluated. The @Text argument can be of data types that are implicitly convertible to nvarchar or ntext.
 
Return Types
bit
Remarks
·         ISNUMERIC returns 1 when the input expression evaluates to a valid integer, floating point number, money or decimal type; otherwise it returns 0. A return value of 1 indicates that expression can be converted to at least one of the numeric types.
·         wct.ISNUMERIC evaluates fractions as TRUE.
·         wct.ISNUMERIC evaluates numbers with leading, trailing, or embedded spaces as TRUE.
·         wct.ISNUMERIC evaluates numbers ending with the percent grammalogue (%)as TRUE.
·         wct.ISNUMERIC evaluates the decimal point and SPACE or SPACE and the decimal point as FALSE.
·         Any string that wct.ISNUMERIC evaluates as TRUE, can be converted to a floating point number using the wct.VALUE function.
Examples
 
select wct.isnumeric('3/8')
 
This produces the following result
-----
1
 
(1 row(s) affected)
 


select
wct.isnumeric('50.0%')
 
This produces the following result
-----
1
 
(1 row(s) affected)
 


select
wct.isnumeric('3.14159 26535 89793 38462')
This produces the following result
-----
1
 
(1 row(s) affected)



select wct.isnumeric('-5 3/4')
This produces the following result
-----
1
 
(1 row(s) affected)



select wct.isnumeric(' . ')
This produces the following result
-----
0
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service