So, for referential integrity, I do not recommend reusing identifiers. With maximum restrictions on int and bigint, you should never run out of unique values. Unique values ββare the core of reference databases.
With that said, you can run a search routine (or instead of a trigger) to find the lowest id available. Then briefly turn off the inserts of identifiers, insert the data, then turn on the inserts again.
There are so many reasons not to do this! Among which there are all potential collisions between data insertion, when more than one value comes simultaneously.
mcfea source share