alter table add column question



Is there a way to specify what position a column is in the table when
altering tables in code? I have a client that has me do major updates
annually which involve removing obsolete columns and adding new columns. I
set up code in batches and thoroughly test things before altering their
production data. So I might have a prg file that does soemthign like this
(dumb example but you'll get the idea):

alter table Customer drop column KidsNames
alter table Customer add column DogsNames c(50)

Let's say there are 12 columns in the table and I'd like DogsNames to occupy
the 6th position. I know of course that I can do "modi stru" and move it
manullly but that defeats the purpose of writing my code. How can I position
columns so that they are not just tacked onto the end of the table?

Thanks,

Keith


.



Relevant Pages

  • Re: alter table add column question
    ... > set up code in batches and thoroughly test things before altering their ... > alter table Customer drop column KidsNames ... > alter table Customer add column DogsNames c ...
    (microsoft.public.fox.programmer.exchange)
  • Re: (OT)If Darth Vader were designed by Japanese schoolgirls...
    ... not for those with an aversion to pink... ... "I am altering the hemline. ... Pray I don't alter it any further." ...
    (rec.arts.anime.misc)
  • Re: alter table add column question
    ... Keith G Hicks wrote: ... > set up code in batches and thoroughly test things before altering their ... > alter table Customer add column DogsNames c ... Are you writing code that relies on column positions? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Alter table command vs table copy/rename
    ... Does anyone know what the pros and cons are of doing an alter table ... They were told that altering the table causes a roll ... and that this is extremely slow. ... table statement rather than the copy/rename method. ...
    (microsoft.public.sqlserver.programming)
  • Re: self-aware list of objects able to sense constituent member alterations?
    ... where,  in the midst of a lot of processing I might do something like, ... which alter the properties of the object 'a'. ... Even better would be to automatically percolate the subsequent changes ... that resulted from altering 'a' for the rest of the items in the list. ...
    (comp.lang.python)