Trigger Editor |
Previous Index Next How To Use |
Triggers usually are small pieces of code that are executed automatically by the database engine before or after certain actions occur on a table (or sometimes: a view).
The Trigger Editor offers the possibility to create, alter and drop triggers. If you add or drop a trigger, the Triggers node in the Database Navigator tree-view will display the change as well by adding or deleting the trigger from the list.
Below is an example of the MS SQL Trigger Editor: A Microsoft SQL Server Trigger Editor
The "{..}" button will turn the current line or text selection in the source editor box into a comment, or remove the comment from the current line.
In order to create a new trigger, you first need to select a table or view from the drop down box. By default, triggers will be named according to a name template.
See also: Object Template Editor
Tip! Dragging (a) column(s) from the Database Navigator or Describe Companion into the code editor will allow you to auto-create variables with the same datatype as the column(s) or insert the column name as simple text. The variables get names assigned according to the Name Template Code Variable.
Load from/Save to fileThe Load From File and Save To File buttons can be used to load previously saved trigger code or save the current trigger to a file. These files aren't straight DDL script files, but a custom XML format. Saving a trigger to a file can be useful if you cannot compile it yet, but need a way to store your code. You can continue working on the trigger another time.
|