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

how do I drop a column

0 views
Skip to first unread message

John Lindsey

unread,
Jan 6, 1997, 3:00:00 AM1/6/97
to

What is the opposite of

alter TABLE add column ...

I've added columns to a database that I am working on, and I cannot
figure out how to remove them. I can delete the data in them, but I am
unable to kill the column entirely. It is even possible?


John
--
And the red foos did slay the purple foos, and the green foos the pink foos.
And the silver foos did lord over the orange foos, in a way that was bad.
And the yellow foos detonated a small thermonuclear device at the blue foos.
And there were slain foos in great abundance, such that they were everywhere.

Roger Rouse

unread,
Jan 7, 1997, 3:00:00 AM1/7/97
to

You'll need to recreate the table (under a new name) without the column,
and insert the rows from the original (less the offending column) into the
new table. Now drop the original table and rename the new version to the
original name.

Roger

John Lindsey <jl...@acmez.gatech.edu> wrote in article
<5as2pl$5...@catapult.gatech.edu>...

William Zhou

unread,
Jan 9, 1997, 3:00:00 AM1/9/97
to

You can't drop a column in SQL Server 6.5 although somewhere in reference
does mention you can.
To work around is using BCP.

John Lindsey <jl...@acmez.gatech.edu> wrote in article
<5as2pl$5...@catapult.gatech.edu>...
> What is the opposite of
>
> alter TABLE add column ...
>
> I've added columns to a database that I am working on, and I cannot
> figure out how to remove them. I can delete the data in them, but I am
> unable to kill the column entirely. It is even possible?
>
>

Michael Yocca

unread,
Jan 10, 1997, 3:00:00 AM1/10/97
to

You will need to drop the table and recreate it.  I have a procedure
that makes this process easier http://users.sgi.net/~myocca/sql/sp
follow the link for my_xfer.
--
Michael Yocca Database Analyst PPG Industries, Inc., Pittsburgh, PA  yo...@ppg.com
President PGH SQL Server Users Group http://users.sgi.net/~myocca/sql/pghssug
Why is it that they call the place you drive your car a parkway but, they call the place that you park cars a driveway?
disclaimer "The opinions expressed are those of the writer and not of PPG Industries, Inc. nor any PPG-associated company."

0 new messages