Creating Delete Queries
You can delete multiple rows in one operation by using a
Note Deleting all rows from a table clears the data in the table but does not delete the table itself. You can delete tables using the Database Designer. For information about using the Database Designer, see Database Designer.
When you create a Delete query, the Grid pane changes to reflect the options available for deleting rows. Because you do not display data in a Delete query, the Output, Sort By, and Sort Order columns are removed. In addition, the check boxes next to the column names in the rectangle representing the table or table-structured object are removed because you cannot specify individual columns to delete.
Caution You cannot undo the action of executing a Delete query. As a precaution, back up your data before executing a Delete query.
To create a Delete query
- Add the table to delete rows from to the Diagram pane.
- Right-click in the Query Designer window, point to Change Type, and then choose Delete.
Note If more than one table is displayed in the Diagram pane when you start the Delete query, the Query Designer displays the Delete Table dialog box to prompt you for the name of the table to delete rows from.
- Enter search conditions to define the rows to be deleted. For details, see Specifying Search Conditions. If you do not specify a search condition, all rows in the specified table will be deleted.
Note Because you cannot delete the contents of individual columns, the check boxes in the rectangle representing the table or table-structured object are removed when you start a Delete query. To add columns to the Grid pane to use in search conditions, drag them from the rectangle representing the table or table-structured object to the Columns column, or select a data column in the Columns column.
When you execute the Delete query, no results are reported in the Results pane. Instead, a message appears indicating how many rows were deleted.