Converting int primary key to bigint in Sql Server -


We have a production table with 770 million lines and changes. To allow future development, we want to change the primary ID column to increase the primary ID column for future growth (and to prevent sudden shutdown)

Dev's experiments have shown that this column It is not as simple as changing because we have to leave the index and then have to recreate it. So far, the defect in the index is not finished after 1 and one-and-a-half hours (Devi which is slightly less than Prodi). This table has been hit 24/7 and offlineing it for so long is not an option.

Has anyone else had to deal with such a situation?

Edit: Additional information:

  • The primary key

    You can try a phased approach.

    1. Create a new build column
    2. Create an insert trigger to synchronize with 2 columns
    3. All empty in the Biltin column Run updates to populate values ​​
    4. Change the primary index on the new index from your old ID column
    5. Questions for using any of the points of the FK and the new column
    6. Change the new column to become your identity column and Remove from the # 2 trigger trigger
    7. Delete the old ID column

      You should spread the pain on them instead of killing it at once 7 steps

Comments