SQL Detecting if only integers in varchar -
this question has answer here:
- how numeric column values? 5 answers
 
i'm hoping there basic string function haven't found yet.
specifically scenarios length of string unknown: there succinct method of telling if string variable contains [0-9] values?
for example, following method works require additional mention of possible characters appear other numerals.
select var  #table1  var not '%[a-z]%'   and
select var  #table1  var '[0-9][0-9][0-9][0-9][0-9]...'   doesn't work because length of var required filter.
thanks in advance
select var #table1  var not '%[^0-9]%'       
Comments
Post a Comment