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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to remove a column
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AdamWest
Constraint Violating Yak Guru

USA
360 Posts

Posted - 09/09/2013 :  08:47:22  Show Profile  Reply with Quote
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]

Edited by - AdamWest on 09/09/2013 08:58:53

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 09/09/2013 :  09:41:12  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000