renumbering

  • 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?

  • This was removed by the editor as SPAM

  • Add the column using an ALTER TABLE syntax and set the IDENTITY property.

    ******************
    Dinakar Nethi
    Life is short. Enjoy it.
    ******************

  • 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

  • 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