Iron clad?
-- prepare test data
declare @test-2 table (t varchar(50))
insert @test-2
select 'ov1' union all
select 'ov2' union all
select 'ov4' union all
select 'ov31' union all
select 'ssss1' union all
select 'ssss99'
-- show data before inserting new values
select * from @test-2
-- do the work
declare @prefix varchar(50)
select @prefix = 'ov' -- Throw anything in!
insert @test-2
select@prefix + convert(varchar, t.n + 1)
from(
selectmax(convert(int, substring(t, 1 + len(@prefix), 50))) n
from@test-2
wheret like @prefix + '%'
and not substring(t, 1 + len(@prefix), 50) like '%[^0-9]%'
) t
wherenot @prefix like '%[0-9]%'
and not t.n like '%[^0-9]%'
-- show data after inserting new values
select * from @test-2
N 56°04'39.16"
E 12°55'05.25"