July 1, 2003 at 1:04 am
Hi there ... What would the ideal method of adding an Identity field into a large table be, taking into account that a simple
ALTER TABLE <TableName> ADD <IdField> INT IDENTITY causes a time-out ... Ideas, anyone?
July 1, 2003 at 7:03 am
Doesn't anybody have any pointers on this?
July 1, 2003 at 7:46 am
not an ideal solution, but a more long winded approach would be:
--create a new, empty table copied from the original table structure
--add the identity field to this new table
--copy all the data from the original table into the new table
--bin the original table
--rename the new table
I don't know why you get a timeout in the first place though ..
July 1, 2003 at 9:01 am
Steve, you might want to give us all time to wake up, read email etc.
Do you have something else accessing the table?
Andy
July 2, 2003 at 6:27 am
Don't know why you get timeout either but I agree with planet115's answer. Another alternative is to bcp out, create new table and bcp back in. I have done copies both ways in the past with large tables (not with identity though).
Edited by - davidburrows on 07/02/2003 06:27:53 AM
Far away is close at hand in the images of elsewhere.
Anon.
July 2, 2003 at 5:28 pm
I'll go with the BCP suggestion of DavidBurrows.
July 3, 2003 at 12:42 am
Hey guys - thanks for the advice and my apologies on getting impatient 🙂
Turns out that the components being used to alter the table had a hardcoded timeout time. This has now been fixed and the timeout extended.
See ya'll later!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply