Re: Alter table command vs table copy/rename
- From: bpdee <bpdee@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Jun 2009 07:37:01 -0700
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
- Follow-Ups:
- Re: Alter table command vs table copy/rename
- From: Aaron Bertrand [SQL Server MVP]
- Re: Alter table command vs table copy/rename
- References:
- Alter table command vs table copy/rename
- From: bpdee
- Re: Alter table command vs table copy/rename
- From: Uri Dimant
- Alter table command vs table copy/rename
- Prev by Date: Re: concatenating a % in reporting services
- Next by Date: Re: Alter table command vs table copy/rename
- Previous by thread: Re: Alter table command vs table copy/rename
- Next by thread: Re: Alter table command vs table copy/rename
- Index(es):
Relevant Pages
|