palum
palum

Reputation: 233

alter table xyz drop column

I have a table with 200 column, I have to drop 96 columns from this table.

Using the statement

alter table XYZ drop column a,b,c,d...................

is taking forever to drop the column on SQL Server2000

Can anyone help or give me some idea how can this be done effitiently..

thanks

Upvotes: 0

Views: 227

Answers (1)

Christopher J Smith
Christopher J Smith

Reputation: 150

This is not a trivial change to ask of any RDBMS and IS likely to take a while. Depending on the platform, it might also be exacerbated if there are a lot of rows and the columns you're dropping contain non-null data.

Perhaps it would be more feasible to SELECT the columns you want to keep into a new table, drop this one, and rename the new table to the original table name.

Answer intentionally written generically

Upvotes: 2

Related Questions