Thanks in advance for your support.
if @v like "%[^0-9]%"
begin
print "string is not numeric"
end
else
begin
print "string is numeric"
end
You can exclude spaces by adding a space to the pattern inside the brackets.
HTH,
Rob V.
-----------------------------------------------------------------
Rob Verschoor
Certified Sybase Professional DBA for ASE 15.0/12.5/12.0/11.5/11.0
and Replication Server 15.0.1/12.5 // TeamSybase
Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (ASE 15 edition)
"The Complete Sybase ASE Quick Reference Guide"
"The Complete Sybase Replication Server Quick Reference Guide"
mailto:r...@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., Amersfoort, The Netherlands
Chamber of Commerce 27138666
-----------------------------------------------------------------
<SenthilKumar> wrote in message news:4a267b4b.300...@sybase.com...
select case when a like "%[^0-9]%" then 0 else
convert(int,a) end from tb1
--------
12345
0
0
0
64891