Determine if a string is numeric: Difference between revisions
Content added Content deleted
(add SQL) |
|||
Line 216:
==[[SQL]]==
[[Category:SQL]]
-- Tested on Microsoft SQL Server 2005
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'
==[[Tcl]]==
|