SQL Server - Check if variable or column is numeric

by Administrator 7. October 2009 18:39

The simplest way to check if a value is numeric is to use the 'ISNUMERIC' function

-- This returns 1

select ISNUMERIC('1.1')

-- This returns 1

select ISNUMERIC('12')

-- This returns 0

select ISNUMERIC('aaaa')


Buy Me a Beer ?

If you've found this site useful, you could help support its running costs by either checking out the adverts on the page if you find anything that interests you - or by making a small donation