Here is my code. I want only numeric character. If it is other than numeric, should not print.
Here @msg is substring of one of string,which dynamically created.So I can not change type of @msg to int.It can be ',,3' or '4,,,',etc.Sometime @msg contain comma,so I want to check for numeric.Isnumeric() consider comma as numeric.I gives 1 as result.How to handle it?
Declare @msg varchar(5)
set @msg = ',5'
if(isnumeric(@msg) = 1)
begin
print 'Numeric'
-- logic
end