There are times when you have a limited range of ids and these have to be re-used as they become available.
The script lists the first missing id in a table.
Note that this script works best for a table with a limited number of rows, say sub 100,000
I tested this on a PIII 500MHz 256Mb RAM on a 1 million record table with 500 records missing and only 1 user and it took 14 seconds.
For most DBAs, normalization is an understood concept, a bread and butter bit of knowledge. However, it is not at all unusual to review a database design by a development group for an OLTP (OnLine Transaction Processing) environment and find that the schema chosen is anything but properly normalized. This article by Brian Kelley will give you the core knowledge to data model.