By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,101 Members | 1,426 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,101 IT Pros & Developers. It's quick & easy.

Update auto increment feild to replace nulls

P: 1
I forgot to turn on auto increment when I reinstalled this database and now I have a bunch of NULL values in my ID field for last few hundred inserts, how can I update this table to replace the NULLS with a new ID value where the ID is an auto increment with out losing the ID values of old records, basically i want to do this:
UPDATE ID SET id = 'NEW AUTO #' where ID = 'NULL'

I hope this makes sense, I am not bound to having the numbers sequential to the old records so I was going to set the identity seed at 5000 (my old records stopped at id 4350 ) so if i start to seed from 5000 i know i wont use same ID
Aug 11 '08 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
See if this thread helps.
Aug 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.