nie użyj tego do uzupełnienia „brakujących” identyfikatorów, ale to powinno działać:
Insert Into t (id)
Select Coalesce( Min(t.id) + 1, 0 )
From t
Left Join t As t2 On ( t2.id = t.id + 1 )
Where t2.id Is Null
Pobierz wszystkie id s gdzie id + 1 nie istnieje (Left Join ) i wstaw Min(id)+1 lub 0 jeśli brak jest dostępny.