UNKNOWN --************************************** -- Name: Check only for numeric digits without using a loop -- Description:The ISNUMERIC function in SQL60/65/70 checks for decimal & integer values. Hence characters like D, E are valid float representations & similarly ','. This is a simple logic that can check only for numeric digits without using a loop of any kind -- By: Umachandar -- -- -- Inputs:None -- -- Returns:None -- --Assumes:None -- --Side Effects:None --This code is copyrighted and has limited warranties. --Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.195/lngWId.5/qx/vb/scripts/ShowCode.htm --for details. --************************************** -- The numbers are hard-coded in the SELECT below but -- use a NUMBERS table instead. This table can also be -- used to solve several other problems quite easily. declare @c varchar(10) select @c = '12' + char(9) if exists(select * from (select 1 as digit union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9 union all select 10) as n where ascii(substring(@c, digit, 1 )) not between 48 and 57 ) print 'No' else print 'Yes' -- Or to check for unsigned integers alone if patindex( '%[^0-9]%' , @c ) > 0 print 'No' else print 'Yes'