How to remove a column from an existing table?

前端 未结 11 1006
旧巷少年郎
旧巷少年郎 2020-12-12 11:22

How to remove a column from an existing table?

I have a table MEN with Fname and Lname

I need to remove the Lnam

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 11:54

    This can also be done through the SSMS GUI. The nice thing about this method is it warns you if there are any relationships on that column and can also automatically delete those as well.

    1. Put table in Design view (right click on table) like so:

    1. Right click on column in table's Design view and click "Delete Column"

    As I stated before, if there are any relationships that would also need to be deleted, it will ask you at this point if you would like to delete those as well. You will likely need to do so to delete the column.

提交回复
热议问题