April 5, 2006 at 10:52 pm
I have a 50,000 records table and now i need put a new field (id_x).
Do you know how i fill 'id_x' field with 1,2,3,4,5,.... 50000?
April 10, 2006 at 8:00 am
This was removed by the editor as SPAM
April 10, 2006 at 12:00 pm
Add the column using an ALTER TABLE syntax and set the IDENTITY property.
******************
Dinakar Nethi
Life is short. Enjoy it.
******************
April 10, 2006 at 7:43 pm
Hi Dinakar Nethi,
Thanks for your response, it works, but now i have another similar problem.
How do I renumberig my ID_X column if I lost the correct secuency?
The current secuency is wrong because some DELETE sentences.
Bye.
Antonio Arciga
April 11, 2006 at 5:56 pm
If you need to have things consistent and no gaps, you probably won't want to use IDENTITY for that column. You can do some searches on how to find gaps in SQL - there are some really good posts in this forum and others on that topic. That will help you know when to fill in the gaps.
Is this necessary that you have a continuous set of numbers? If not, you may want to just let it go. Often the maintenance for filling in gaps incurs more overhead than just letting it go where it's possible to do that.
-Pete
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply