DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Add new field to an existing table

  1. #1
    Join Date
    Jun 2001
    Posts
    31
    Hi...

    I need help on adding a new field in an existing table.
    But, the problem is that this field must be added after a particular field in the middle of the table.

    Does anyone have a solution?
    AED

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    1. export your table
    2. drop table
    3. create table like you want
    4. import data with ignore=y


    or, you can
    1. add newfield to your table
    2. create table2 as select a, b, newfield, d from your_table
    3. recreate any constraints/indexes for table2 from your_Table
    4. drop your_table
    5. rename table2 to your_table
    Jeff Hunter

  3. #3
    Join Date
    Jun 2001
    Posts
    31
    Thanks o lot Jeff... It worked.

    AED

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    The real question is, why shuld physical position of the column inside a table make any difference?

    If for whatever reason your application realy demands a specific order of columns, then you should probably re-check the sanity of an application design....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Application demaning the colums in a certain order!!!! Thats creapy...

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


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