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

2023-07-01 11:58:00 -04: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'