RosettaCodeData/Task/Determine-if-a-string-is-numeric/SQL/determine-if-a-string-is-numeric.sql

8 lines
167 B
MySQL
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
declare @s varchar(10)
set @s = '1234.56'
print isnumeric(@s) --prints 1 if numeric, 0 if not.
if isnumeric(@s)=1 begin print 'Numeric' end
else print 'Non-numeric'