You can get the next value of the
Id
from
SQL Server
, see, for instance
get the next value of identity[
^] . if you make the (somewhat unsafe) assumption that only your code deals with the table than you may record
IDENT_CURR
and
IDENT_INCR
values in order to compute next ones.