select min(i+1)
from tbl t1
where not exists (select * from tbl t2 where t1.i = t2.i+1)
select top 1 t1.i+1
from tbl t1
left join tbl t2
on t1.i = t2.i+1
where t2.i is null
order by t1.i
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.