Rename a trigger (ADP)

Microsoft Office Access 2003

Show All Show All

Rename a trigger (ADP)

Note  The information in this topic applies only to a Microsoft Access project (.adp).

When you change the name of a trigger, the trigger name is updated in your database as soon as you save the trigger. However, you'll need to update any references to the previous name in other areas where you've referenced it, such as in code.

  1. Open the trigger.

    ShowHow?

    You can open a trigger to view or edit the text of an existing trigger that is stored in your database. Triggers are scripted in Transact-SQL for Microsoft SQL Server databases.

    1. In the Database window, click Tables Button image under Objects.
    2. Right-click the name of the table whose trigger you want to open and choose Triggers from the shortcut menu.
    3. In the Triggers for Table: <table name> dialog box, select the trigger you want to open from the Trigger Name list, and then click Edit.

    The trigger is opened in the SQL source code editor which you can use to edit the SQL statements. For more information about triggers and the CREATE TRIGGER SQL statement, see the Microsoft SQL Server documentation.

  2. In the SQL source code editor, replace the existing trigger name with the new name. (The trigger name appears after the Create Trigger statement.)
  3. Click Save Button image to save the new trigger.
  4. Delete the old trigger (unless you want two identical triggers with different names).

    ShowHow?

    When you want to disable the actions defined in the trigger that are automatically carried out on your database immediately following the specified transactions, you can delete a trigger.

    You might also want to delete any triggers that enforce referential integrity between related tables if you use database diagrams to design your database. Database diagrams use relationships instead of triggers for this purpose. Thus, if a trigger duplicates a relationship in a database diagram, you should delete either the trigger or the relationship.

    1. In the Database window, click Tables Button image under Objects.
    2. Right-click the table whose trigger you want to delete and choose Triggers from the shortcut menu.
    3. In the Triggers for Table: <table name> dialog box, select the trigger you want to delete from the Trigger Name list, and then click Delete.
    4. A message prompts you to confirm the deletion. Choose Yes.

The new trigger name is now in the database.