Edit

Share via


Remove tables from queries (Visual Database Tools)

Applies to: SQL Server

You can remove a table - or any table-valued object - from the query.

Note

Removing a table or table-valued object doesn't delete anything from the database; it only removes it from the current query. For details about removing a table from a database, see Delete Tables (Database Engine).

Remove a table or table-structured object

  • In the Diagram Pane, select the table, view, user-defined function, synonym, or query, and then press DELETE, or right-click the object and then choose Remove in the resulting dialog box. You can select and remove multiple objects at one time.

    -or-

  • Remove all references to the object in the SQL Pane.

When you remove a table or table-valued object, the Query and View Designer automatically removes joins that involve that table or table-valued object and removes references to the object's columns in the SQL Pane and Criteria Pane. However, if the query contains complex expressions involving the object, the object isn't automatically removed until all references to it are removed.