Reputation: 233
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
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