[thelist] SQL Question: "Fill in" missing auto-increment records

rudy r937 at interlog.com
Sat May 25 23:45:01 CDT 2002


> What I am wanting to do is have some kind of SQL query
> that finds the "missing" ID numbers and puts the next user record
> in its spot instead of assigning it the next auto_incremented ID number.

hi david

short answer: don't

long answer: if you can convince me you have a good reason, i will try to
talk you out of it

ever heard the expression "six of one, a half dozen of the other"?  this
isn't like that

what you suggest will take a heck of a lot of work (consider: how do you
know when the gaps have all been filled in and you can turn the autonumber
back on? you don't -- and anyhow, how do you turn an autonumber off?)

in the end, you get no benefit


rudy
http://rudy.ca/




More information about the thelist mailing list