sync - SQL multiple tables with synced IDENTITY columns -
i working on "cleaning up" database , need synchronize identity columns. using stored procedures handle data , mirror 1 table next (after cleaning , correcting datatypes). @ point in future want cut off old table , use new table, question how have identity field stay in sync while both in use... once old table removed new 1 need continue auto-incrementing , rebuilding/altering change identity field not option. possible or there better way go this?
my other thought create lookup table store id columns of both tables , anytime there insert in new table take old id , new id , insert them lookup table. kind of messy once old table out of way tho.
- set new table's identity non-identity field.
- modify either data population procedures populate non-identity field on new table old table's identity value.
- at cutover, switch new field auto-increment , set seed number accordingly.
Comments
Post a Comment