How to check numeric value in sql?
Are you looking for way to check a value is numeric or not? Read this thread to get help.
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)