Sql Server Isnumeric Function

SQL Server: ISNUMERIC Function

In this post explains how to use the ISNUMERIC function in SQL Server (Transact-SQL) with syntax and examples.

Description

In SQL Server (Transact-SQL), the ISNUMERIC function returns 1 if the expression is a valid number. Otherwise, it returns 0.

Syntax

The syntax for the ISNUMERIC function in SQL Server (Transact-SQL) is:

ISNUMERIC( expression )

Parameters or Arguments

expression

The value to test whether it is a numeric value.

Note

  • The ISNUMERIC function returns 1, if the expression is a valid number.
  • The ISNUMERIC function returns 0, if the expression is NOT a valid number.

Applies To

The ISNUMERIC function can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

Example

Let's look at some SQL Server ISNUMERIC function examples and explore how to use the ISNUMERIC function in SQL Server (Transact-SQL).

For example:

SELECT ISNUMERIC(1234);
Output: 1

SELECT ISNUMERIC('1234');
Output: 1

SELECT ISNUMERIC(10 * 5);
Output: 1

SELECT ISNUMERIC('AODBA.com');
Output: 0

SELECT ISNUMERIC('2014-05-01');
Output: 0