I work on SQL server 2012 I have issue I can't update status to Numbers only when whole field have digits only from 0 to 9 . but if it have only one character or precision then it will be not valid .
1222 valid
223g not valid
create table #acceptnumbersOnly
(
KeyValue nvarchar(50),
Status nvarchar(50)
)
insert into #acceptnumbersOnly(KeyValue)
values
('233'),
('g25k'),
('25k'),
('gkg'),
('145'),
('45.5')
Expected result will be :
KeyValue Status
233 Numbers only
g25k Not Valid Numbers Only
25k Not Valid Numbers Only
gkg Not Valid Numbers Only
145 Numbers only
45.5 Not Valid Numbers Only