The best part of any blog is when readers ask each other questions. Better still, is when a reader takes the time to provide a detailed response.
A few days ago, one of my readers, Yasmin, asked a very interesting question:
How we can find the list of tables whose identity was missed (not is sequential order) within the entire database?
A big thank you to SQL Server Expert, Imran Mohammed, for his excellent response to this question. He also provided an extremely impressive script, which is well described and contains inline comments.
We will now see the same example with the solution to the above gap issue. On deleting records, table was reseeded with identity, which was deleted. Download complete SQL Script here.
This script is well worth keeping in your archive for future reference.
If you and use the script, please comment here and let me know about your experience.
If you know any other way that this can be accomplished or have a different solution, please post your comment here, or send me an email and I will publish it with due credit.
Reference : Pinal Dave (https://blog.sqlauthority.com)