Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to remove a column

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2013-09-09 : 08:47:22
I have this table as below and I want to remove the last column (DESCRIPTION_EXTENDED). It is used in newer version of app but I want to keep the orig. as it was. What is the process to remove this column? I understand to use ALTER and DROP but do I have to something else?

SELECT TOP 1000 [ID]
,[FACILITY_KEY]
,[FIRST_LEVEL_CAT]
,[SECOND_LEVEL_CAT]
,[UNIQUE_KEY]
,[DESCRIPTION]
,[ACTIVE]
,[ORIG_ID]
,[COLOR]
,[PARENT_ID]
,[ADDRESS]
,[PHONE]
,[COMMENTS]
,[DESCRIPTION_EXTENDED]
FROM [DPRO2].[OGEN].[SCH_C_RESOURCES]

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-09-09 : 09:41:12
That is all you should need to do unless that column is used as a foreign key in another table (which doesn't sound like it is):
ALTER TABBLE [DPRO2].[OGEN].[SCH_C_RESOURCES] DROP COLUMN [DESCRIPTION_EXTENDED]
Go to Top of Page
   

- Advertisement -