Create an Append Values Query

Caution   You cannot undo the action of an Append Values query. As a precaution, back up your data before executing the query.

Background information

You can create a new row in the current table using an Append Values query. When you create an Append Values query, you specify:

For example, the following query adds a row to the titles table, specifying values for the title, type, publisher, and price:

INSERT INTO titles
 (title_id, title, type, pub_id, price)
VALUES ('BU9876', 'Creating Web Pages', 'business', '1389', '29.99')

When you create an Append Values query, the Grid pane changes to reflect the only options available for inserting a new row: the column name and the value to insert.

Create an Append Values query

  1. In the Database window, click Queries   under Objects, and then click New.
  2. In the New Query dialog box, select Design Stored Procedure.
  3. In the Add Table dialog box, add the table, view, or function you want to append values to, and then click Close.
  4. On the Query menu click Append Values Query.

    Note   If more than one table, view, or function is displayed in the Grid pane when you start the Append Values query, the Query Designer displays the Choose Target Table for Insert Values dialog box to prompt you for the name of the table to update.

  5. Define the data columns to create by adding them to the query. Columns will be updated only if you add them to the query.
  6. In the New Value column of the Grid pane, enter the new value for the column. You can enter literal values, column names, or expressions. The value must match (or be compatible with) the data type of the column you are updating.

    Caution   The Query Designer cannot check that a value fits within the length of the column you are inserting. If you provide a value that is too long, it might be truncated without warning. For example, if a name column is 20 characters long but you specify an insert value of 25 characters, the last 5 characters might be truncated.

When you execute an Append Values query by using the Run button on the Query Designer toolbar, a message appears indicating how many rows were changed.