Compartir a través de


How to: Delete Tables from a Database

You can delete a table from your database using Server Explorer.

Note

A new version of Table Designer appears for databases in the SQL Server 2012 format. This topic describes the old version of Table Designer, which you use with databases in earlier formats of SQL Server.

In the new version, you can change a table definition through a graphical interface or directly in a script pane. If you use the graphical interface, the table’s definition is automatically updated in the script pane. To apply the SQL code in the script pane, choose the Update button. For more information about the new version, see How to: Create Database Objects Using Table Designer.

Warning

Think carefully before you delete a table. If existing queries, views, user-defined functions, stored procedures, or programs refer to that table, the deletion will make these objects invalid.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Customizing Development Settings in Visual Studio.

To delete a table from the database

  1. In Server Explorer, select the table you want to delete.

  2. Right-click the table and choose Delete from the shortcut menu.

  3. A message box prompts you to confirm the deletion. Click Yes.

    Note

    Deleting a table automatically removes any relationships to it.

See Also

Tasks

How to: Create Tables

Other Resources

Working with Tables in Table Designer