c_java wrote:
Yes, I mean i don't want to unnecessarily block primary key (ID) for the records which don't exist. which were added but deleted. I want to set the Increment ID to the max(ID) + 1 .( for e.g there are 10 records then 11 and not 21 assuming that there were 20 records once upon a time)
How to achive this?
You can write your own sequnce generator which does
Code:
select coalesce(max(ID),0)+1 from mytable
Howewer, I would not recommend chasing this goal. You may run into undesired lock on your table.