How to: Delete Columns from a Table

When you delete a column from the table in Table Designer, once you save the changes, it and all the data it contains are deleted from the database.

Warning

This action cannot be undone once the table is saved. The only way to restore a deleted column is to close the table without saving changes.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To delete columns from a table

  1. In Server Explorer, right-click the table from which you want to delete columns and choose Open Table Definition.

    The table opens in Table Designer.

  2. Select the column you want to delete.

  3. Right-click the column and choose Delete Column from the shortcut menu.

  4. If the column participates in a relationship, a message prompts you to confirm the deletion of the selected columns and their relationships. Choose Yes.

If the column does not participate in a check constraint, then the column, any constraints attached to it, any relationships it participates in, and any data contained in the column are provisionally removed from the database. They are permanently deleted from the database when you save the table.

If the column does participate in a check constraint, the database server will reject your modification when you try to save your work. That is, the commit operation will fail. To delete a column that participates in a check constraint, you must first modify or remove the check constraint before you can delete the column.

See Also

Tasks

How to: Delete Tables from a Database

How to: Insert Columns into Tables

Other Resources

Working with Columns