• Sigh... ID's like this should NOT be intelligent, by their very nature they should tell NOTHING of the data. It serves to uniquely identify a row. Thats it.

    Second, any code like this that changes the keys (never should be done, but since we are showing how) needs to be wrapped in a transaction. Otherwise, the risk of assigning the seed to a key that has been used is pretty high.

    Third, this only works if they key isnt a FK somewhere else. Otherwise you face the unenviable task of updating all those rows as well.

    This is on my list of things you should never contemplate doing.