Re: SQL question

From: Patrick Rusk <prusk_at_ctp.com>
Date: 13 Oct 1994 19:06:05 GMT
Message-ID: <37k0et$mbi_at_toon.ctp.com>


Thomas B. Cox writes
> In article <36e7s6$n0f_at_nuscc.nus.sg>,
> Virinchipuram J. A. <fbap3120_at_leonis.nus.sg> wrote:
>
> >One "easy" question, how do I delete a column name from a created table?
> >Thanks for the effort
>
> Well, you could cheat and use SQL Studio 2.0, which has a "drop column"
> option in its table management screen. I have no idea how it does it
> under the covers, but there it is.

        Probably does the following:

        Say that table SPUD has columns A, B, C, and D. You want to remove C. SQL Studio (which I have never dealt with) probably does the following sort of thing:

	create table SPUD_PRIME (
		A	...,
		B	...,
		D	...
	);

	insert into SPUD_PRIME
	values
		select A, B, D
		from SPUD;

	drop table SPUD;

	[rename SPUD_PRIME to SPUD -- don't know syntax for this]

Only SQL Studio is probably being clever about all the indices, triggers, constraints, etc. that are depending upon SPUD and that might freak if SPUD is deleted.

-- 
 /\/\  | Patrick Dean Rusk  prusk_at_ctp.com
/ /_ \ | Cambridge Technology Partners, Inc.
\  / / | 304 Vassar Street, Cambridge, MA 02139
 \/\/  | Phone: (617) 374-8761; FAX: (617) 374-8300
Received on Thu Oct 13 1994 - 20:06:05 CET

Original text of this message