SQL Server: ISNUMERIC Function

ISNUMERIC function in SQL Server

This SQL Server tutorial 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 Servers (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 Servers (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 functions examples and explore how to use the ISNUMERIC function in SQL Servers (Transact-SQL).

For example:

SELECT ISNUMERIC(1234);
Result: 1

SELECT ISNUMERIC('1234');
Result: 1

SELECT ISNUMERIC(10 * 5);
Result: 1

SELECT ISNUMERIC('adglob.in');
Result: 0

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

Leave a Reply