ISNUMERIC (TSQL Function)

Returns 1 if the expression is a valid numeric value. Else, returns 0.

Syntax

ISNUMERIC ( expression )

Arguments

expression
is an expression of type varchar, bit, tinyint, smallint, int, bigint, money, numeric, float.

Return Types

Returns int.

Remarks

If expression is NULL, this function returns 0.

Examples

DECLARE @a INT; -- @a is NULL

PRINT ISNUMERIC(@a);
PRINT ISNUMERIC('123abc');
PRINT ISNUMERIC(14.78);
PRINT ISNUMERIC('-14.78e-3');
PRINT ISNUMERIC(14.78);

The result is:

0
0
1
1
1