Move columns from one table to another
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Move columns from one table to another

Hybrid View

  1. #1
    Join Date
    Aug 2000
    Posts
    132
    I have 2 to 3 columns in one table that really should be in another table. Is there a way to move columns and data over to another table. I was thinking something like creating the a new table with all the columns I want and then doing an insert based on a select. This will be eventually changed on a production database so I need to keep the names of the tables the same. Thanks for any suggestions.

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    You cannot move a column from one table to another table.

  3. #3
    Join Date
    Aug 2000
    Posts
    132
    Any suggested work around?

  4. #4
    Join Date
    Jan 2001
    Posts
    26
    You can create a table with select including all the columns u need. Then drop the original table. Rename the new table u have created to the old table.


  5. #5
    Join Date
    Aug 2000
    Posts
    132
    OK - thats what I thought just wanted to confirm. Thanks.

  6. #6
    Join Date
    Aug 2000
    Posts
    194
    Once you copy the data from the original table, you may just want to drop the columns (oracle 8i onwards).

    (this way you r not dropping the original table)

    Now you can rename the tables, if you need to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width