Developers can use SQL Server “Denali”, MS SQL Server 2008 R2 and MS SQL Server 2005 Table Designer to delete a column. When developers delete a column, once they save the changes, the column and all the data it contains are deleted from the database. The only way to restore a deleted column is to close the table without saving changes. When developers want to delete a column, they should follow the next steps:

1. In Object Explorer, right-click the table to which they want to delete columns and choose Design (Modify in SP1 or earlier).

C# in Depth, 3rd EditionBest VPN app

Table Designer opens.

2. Select the column they 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 them to confirm the deletion of the selected columns and their relationships. Choose Yes.

If the column does participate in a check constraint, the database server will reject developers’ modification when they try to save their work. To delete a column that participates in a check constraint, they must first modify or remove the check constraint before they can delete the column.