gebeurtenis
31 mrt, 23 - 2 apr, 23
De grootste SQL-, Fabric- en Power BI-leerevenement. 31 maart – 2 april. Gebruik code FABINSIDER om $ 400 te besparen.
Zorg dat u zich vandaag nog registreertDeze browser wordt niet meer ondersteund.
Upgrade naar Microsoft Edge om te profiteren van de nieuwste functies, beveiligingsupdates en technische ondersteuning.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
SQL analytics endpoint in Microsoft Fabric
Warehouse in Microsoft Fabric
Determines whether an expression is a valid numeric type.
Transact-SQL syntax conventions
ISNUMERIC ( expression )
The expression to be evaluated.
int
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 items:
Area | Numeric data types |
---|---|
Exact numerics | bigint, int, smallint, tinyint, bit |
Fixed precision | decimal, numeric |
Approximate | float, real |
Monetary values | money, smallmoney |
ISNUMERIC
returns 1
for some characters that aren't 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).
The following example uses ISNUMERIC
to return all the postal codes that aren't numeric values.
USE AdventureWorks2022;
GO
SELECT City,
PostalCode
FROM Person.Address
WHERE ISNUMERIC(PostalCode) <> 1;
GO
The following example uses ISNUMERIC
to return whether the database name and ID are numeric values.
USE master;
GO
SELECT name,
ISNUMERIC(name) AS IsNameANumber,
database_id,
ISNUMERIC(database_id) AS IsIdANumber
FROM sys.databases;
GO
gebeurtenis
31 mrt, 23 - 2 apr, 23
De grootste SQL-, Fabric- en Power BI-leerevenement. 31 maart – 2 april. Gebruik code FABINSIDER om $ 400 te besparen.
Zorg dat u zich vandaag nog registreert