Skip to content

Latest commit

 

History

History
90 lines (72 loc) · 3.44 KB

File metadata and controls

90 lines (72 loc) · 3.44 KB
title ISNUMERIC (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/13/2017
ms.prod sql
ms.prod_service database-engine, sql-database, sql-data-warehouse, pdw
ms.reviewer
ms.technology t-sql
ms.topic language-reference
f1_keywords
ISNUMERIC
ISNUMERIC_TSQL
dev_langs
TSQL
helpviewer_keywords
expressions [SQL Server], valid numeric type
numeric data
ISNUMERIC function
verifying valid numeric type
valid numeric type [SQL Server]
checking valid numeric type
ms.assetid 7aa816de-529a-4f6c-a99f-4d5a9ef599eb
author MikeRayMSFT
ms.author mikeray
monikerRange >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

ISNUMERIC (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-all-md]

Determines whether an expression is a valid numeric type.

Topic link icon Transact-SQL Syntax Conventions

Syntax

ISNUMERIC ( expression )  

Arguments

expression
Is the expression to be evaluated.

Return Types

int

Remarks

ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0. Valid numeric data types include the following:

Exact Numerics bigint, int, smallint, tinyint, bit
Fixed Precision decimal, numeric
Approximate float, real
Monetary Values money, smallmoney

Note

ISNUMERIC returns 1 for some characters that are not numbers, such as plus (+), minus (-), and valid currency symbols such as the dollar sign ($). For a complete list of currency symbols, see money and smallmoney (Transact-SQL).

Examples

The following example uses ISNUMERIC to return all the postal codes that are not numeric values.

USE AdventureWorks2012;  
GO  
SELECT City, PostalCode  
FROM Person.Address   
WHERE ISNUMERIC(PostalCode)<> 1;  
GO  

Examples: [!INCLUDEssSDWfull] and [!INCLUDEssPDW]

The following example uses ISNUMERIC to return all the postal codes that are not numeric values.

USE master;  
GO  
SELECT name, isnumeric(name) AS IsNameANumber, database_id, isnumeric(database_id) AS IsIdANumber   
FROM sys.databases;  
GO  

See Also

Expressions (Transact-SQL)
System Functions (Transact-SQL)
Data Types (Transact-SQL)