How to delete a column in a table?

How to delete a column in a table?

Post by Sungsoo Ki » Mon, 11 Jan 1999 04:00:00



In SQL Server 6.5, I want to delete a column in a table, but I couldn't find
out a way.

And an other thing, I want to change column data type from int to bit. But
bit type is not displayed in the data type assign combo box.

Please help me!

 
 
 

How to delete a column in a table?

Post by Alexander Tarasu » Mon, 11 Jan 1999 04:00:00


In 6.5 - no other way as to move data to the new table with another
structure (insert, BCP, etc) except you have tool which do the same
procedure, but hiding it from you (DBartisan etc)

--
Alexander Tarasul  MCSD
Certified Borland Delphi Developer

http://pages.ripco.com/~shleym

Answers on SQL Server questions at
http://pages.ripco.com/~shleym/sql_answers.htm
===========================================


Quote:>In SQL Server 6.5, I want to delete a column in a table, but I couldn't
find
>out a way.

>And an other thing, I want to change column data type from int to bit. But
>bit type is not displayed in the data type assign combo box.

>Please help me!


 
 
 

How to delete a column in a table?

Post by <s.. » Tue, 12 Jan 1999 04:00:00


Well, you can drop a column using alter table drop <colname>.  But this is
not documented or, more importantly, supported.  I would use the BCP/Select
into routes to change the schema.

Steve

--
Stephen Simpson, Simpson Professional Services
127/BH18 8JE/England
Tel: +44(0)1202 777417
Fax: +44(0)1202 604861
Mobile: +44(0)7771 758417

http://www.sps.mcmail.com

>In 6.5 - no other way as to move data to the new table with another
>structure (insert, BCP, etc) except you have tool which do the same
>procedure, but hiding it from you (DBartisan etc)

>--
>Alexander Tarasul  MCSD
>Certified Borland Delphi Developer

>http://pages.ripco.com/~shleym

>Answers on SQL Server questions at
>http://pages.ripco.com/~shleym/sql_answers.htm
>===========================================



>>In SQL Server 6.5, I want to delete a column in a table, but I couldn't
>find
>>out a way.

>>And an other thing, I want to change column data type from int to bit. But
>>bit type is not displayed in the data type assign combo box.

>>Please help me!

 
 
 

How to delete a column in a table?

Post by Peter » Tue, 12 Jan 1999 04:00:00


perhaps create a temp table just to hold that data in your table that you
want to modify. Move the data to it then drop the orginal table then re
create it with the columns and datatypes you want then copy the data from
the temp table that is holding your original data.


Quote:>In SQL Server 6.5, I want to delete a column in a table, but I couldn't
find
>out a way.

>And an other thing, I want to change column data type from int to bit. But
>bit type is not displayed in the data type assign combo box.

>Please help me!