View previous topic :: View next topic
|
Author |
Message |
Huzefa
New User
Joined: 05 Dec 2006 Posts: 83 Location: Bangalore
|
|
|
|
Hi All,
I have a table which currently have 5 columns.
2 columns in the table are useless and hence I want to remove the 2 columns from the table.
I believe we do not have DROP COLUMN facility in DB2.
Hence for achieving this one option that I think about is copying the current table values into temporary table and then drop the old table and recreate it with required columns and copy the data from the temporary table to the new table.. But this seems to be a costly affair..
Could anyone suggest any other option or method to achieve this..
Thanks in advance |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Huzefa,
You cannot delete columns from a non-empty table. You need to follow the approach mentioned in your post. |
|
Back to top |
|
|
Huzefa
New User
Joined: 05 Dec 2006 Posts: 83 Location: Bangalore
|
|
|
|
Thanks for the reply
But other than the way I mentioned, is there some another way how I can acieve my purpose |
|
Back to top |
|
|
|