Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multiple columns in single ALTER TABLE statement?

812 views
Skip to first unread message

Randall Parker

unread,
Aug 31, 2001, 8:30:34 PM8/31/01
to
Can one modify multiple columns in a single ALTER TABLE statement?
It doesn't look like it from the syntax diagram.

Also, can one set a column to NOT NULL and to DEFAULT AUTOINCREMENT
in a single ALTER TABLE statement? Again it doesn't look like it.

Paul Horan[TeamSybase]

unread,
Sep 1, 2001, 12:05:30 PM9/1/01
to
Yes, of course you can. Just separate the individual columns being altered
with commas.

Alter table MyTable
MODIFY Column1 default 1,
DROP Column15,
ADD Column79 varchar(20)
;

There are things you can't logically do, like add a column with a NOT NULL
constraint to a table with existing data - that has to be done in three
separate steps.

Paul Horan [TeamSybase]
Buffalo, NY

"Randall Parker" <rgpa...@west.net> wrote in message
news:MPG.15f9b28a1...@forums.sybase.com...

0 new messages