问题
I wish to drop a table column in SQL Server 2012, without affecting other columns in the table (and their data).
How can I do this? Is it possible at all?
So far I've tried deleting the column via SQL Server Management Studio, but this says the whole table must be dropped and re-created.
回答1:
From MSDN
ALTER TABLE dbo.Table DROP COLUMN column_b
回答2:
ALTER TABLE table_name
DROP COLUMN column_name
回答3:
To drop column
alter table tblname drop column colname
To add column
alter table tblname add colname datatype
来源:https://stackoverflow.com/questions/13491554/how-do-i-drop-a-table-column-in-sql-server-2012