Re: Alter table command vs table copy/rename



Yes, sp_rename is also used. I guess the problem that some people had is
altering a table that is quite large in terms of the number of rows in the
table is quite slow.

"Uri Dimant" wrote:

Do you refer to sp_rename system stored procedure as well ? With ALTER
TABLE.... some operations may take some time and slowdown the database
especially while users work on that table, so creating a new table and then
rename makes sense under some circumstance...



"bpdee" <bpdee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:76FE4F74-1402-40BD-B88B-E458148BB018@xxxxxxxxxxxxxxxx
Hi,

Does anyone know what the pros and cons are of doing an alter table
statement rather than copy/rename table method to make table changes? For
years now, we have a product where the way they make schema changes is by
copying the table, rebuilding a table with the change like adding a new
column, bring the data back in, and then renaming the table back to the
original name. They were told that altering the table causes a roll
through
all of the rows in a table once for each new column being added to the
table
and that this is extremely slow. It seems that it's better to do an alter
table statement rather than the copy/rename method.

Thanks,
Dee



.



Relevant Pages

  • Re: Alter table command vs table copy/rename
    ... to guess it is because of bad database design. ... some debate over here regarding alter table vs. copy/rename. ... and that this is extremely slow. ... table statement rather than the copy/rename method. ...
    (microsoft.public.sqlserver.programming)
  • Re: Alter table command vs table copy/rename
    ... some debate over here regarding alter table vs. copy/rename. ... and that this is extremely slow. ... table statement rather than the copy/rename method. ...
    (microsoft.public.sqlserver.programming)
  • Re: alter table add column question
    ... > set up code in batches and thoroughly test things before altering their ... > alter table Customer drop column KidsNames ... > alter table Customer add column DogsNames c ...
    (microsoft.public.fox.programmer.exchange)
  • Re: (OT)If Darth Vader were designed by Japanese schoolgirls...
    ... not for those with an aversion to pink... ... "I am altering the hemline. ... Pray I don't alter it any further." ...
    (rec.arts.anime.misc)
  • alter table add column question
    ... set up code in batches and thoroughly test things before altering their ... alter table Customer drop column KidsNames ... alter table Customer add column DogsNames c ...
    (microsoft.public.fox.programmer.exchange)