Creating a Trigger

See Also

A trigger is a database object that you create by specifying:

You write triggers in Transact-SQL for Microsoft® SQL Server™ databases or PL/SQL for Oracle databases.

To create a trigger

  1. In Data View, expand the Tables folder.

  2. Right-click the name of the table that you want to create a trigger on.

  3. Choose New Trigger from the shortcut menu.

  4. A new trigger is created in a source code editor with the default SQL statements already defined for you.

  5. Modify the default trigger text as follows:
    Replace With
    TABLE1_Trigger1 The name you want to assign to the trigger
    dbo.TABLE1 The name of the table you want to attach the trigger to
    /*Insert, Update, Delete*/ The type of transactions that will activate this trigger
    /*If Update (column_name) …*/ The transactions that will take place

  6. Write the remaining trigger text in SQL.

For syntax and examples of triggers, see your database documentation.