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

Deleting columns in SQL

0 views
Skip to first unread message

rjm...@bu.edu

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

This is probably a real simple question but I can't seem to find the answer.

When developing a database in SEM is there anyway to delete a column or to at
least change some of the properties other than the name of the column. I've
been working in Access 95 and this is allowed, but SQL server seems to be much
less flexible. Once a column is defined it seems unchangeable. In addition
if I link to the table from Access, I can delete a column but it wont let me
save my changes. Is the answer just to plan the implementation better and
make no mistakes????????? I would appreciate any assistance.

Sincerely,

Bob McDermott

Alan Chorozy

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

Example:
Table abc
col1 char(1),
col2 int,
col3 int
You want to remove col2

SELECT col1,
col3
INTO new_abc

DROP TABLE abc

sp_rename new_abc,abc


Leonhardt Wohlschlager

unread,
Jan 11, 1997, 3:00:00 AM1/11/97
to rjm...@bu.edu

Hi Bob,

unfortunately, SQL Server 6.5 is that inflexible as far as the
modification of the relations is concerned.

You can only add a column or modify the rules of integrity.

This means that you have to transfer the data from the old relation to the new one using
the SELECT INTO - command.

Sincerely,

Leonhardt (from Cologne, Germany)

Quah Siew Thiam

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

not that i know of that u can delete a column.

in fact, apart from the column name, any changes to make, u will have to
drop the table and recreate it.


--
regards
Quah Siew Thiam
(Temasek Polytechnic, Singapore)
http://www.tp.ac.sg

0 new messages