In this topic, you will learn how to create, edit, delete, duplicate, and manage triggers from Database Explorer.
1. In Database Explorer, right-click a trigger or Programmability > Database Triggers node and select New DDL Trigger.
2. Update the CREATE TRIGGER statement template. For more information, see Database Trigger Designer.
3. At the bottom of the SQL document, click Apply Changes.
1. In Database Explorer, right-click the DDL trigger you want to edit and select Modify via SQL.
2. Edit the DDL trigger.
3. At the bottom of the SQL document, click Apply Changes.
Alternatively, on the top menu, select File > Save or press Ctrl+S.
1. In Database Explorer, right-click the trigger you want to delete and select Delete, or press Delete.
2. Click Yes to confirm the deletion.
Note
You cannot undo the drop trigger operation, as this action permanently deletes its structure. It is recommended that you back up the database before deleting it.
To enable a trigger, in Database Explorer, right-click the DDL trigger and select Enable.
To enable all triggers, right-click the Database Triggers node and select Enable All.
To disable a trigger, in Database Explorer, right-click the DDL trigger and select Disable.
To disable all triggers, right-click the Database Triggers node and select Disable All.
To view a DDL trigger, do one of the following:
1. In Database Explorer, right-click a required DDL trigger and select Duplicate Object.
2. In the Duplicate Object dialog, configure the object settings:
3. Click OK.
1. In Database Explorer, right-click a required trigger and select Generate Script As, then select the statement type.
2. Select the output option:
For more information, see Generate the DDL and DML statements for database objects.
To view trigger properties, in Database Explorer, right-click the trigger or Database Triggers node and select Show Details.
Object Viewer opens, displaying detailed information about the DDL trigger.
To update the DDL trigger to reflect the latest changes, in Database Explorer, right-click the trigger or Database Triggers node and select Refresh, or press F5.
To open the Properties window, in Database Explorer, right-click the trigger and select Properties, or press F4.
You can set which DDL triggers should appear in Database Explorer.
To filter DDL triggers:
1. In Database Explorer, right-click the Database Triggers node and select Filter.
2. In the Filter Settings dialog, configure the filter parameters.
3. Click OK to apply the filter.
Note
When you open the Database Triggers node, the number of objects it contains appears in parentheses next to the node name. This number changes based on your filter settings.