[Zope-DB] How to add a field after another field SQL SERVER

Jim Penny jpenny@universal-fasteners.com
Mon, 15 Apr 2002 10:26:53 -0400


On Sat, Apr 13, 2002 at 02:10:25AM +0200, Mauricio V?lez wrote:
> Hello Everybody
> 
> I'm using sql server and I want to write a script with
> the command ALTER TABLE to add a field.
> By default it is added at the end, but I want to add
> it after another field
> 
> How can I do this?

Completely database dependent.  In most, you cannot directly do this.

The canonical way is to dump your data and the definitions, write a
script to reorder them, drop your table from the database and then
reload the modified dump.  This is a lot of work and is error prone,
so mostly people just don't do it.  After all, by using explicit column
names in your select statements, you can get the order to be whatever
you want, anyway.

Jim Penny

> 
> Regards
> Mauricio
> 
> _______________________________________________________________
> Do You Yahoo!?
> Yahoo! Messenger
> Comunicaci?n instant?nea gratis con tu gente.
> http://messenger.yahoo.es
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>