Use Database Development to specify a system event and define a corresponding event handler.
Prerequisites Before you can create an event, be sure the appropriate data server is running,
and you created and established a connection to the data server.
- In
Enterprise Explorer, under the database connection profile,
expand
the
tree for a database.
- Right-click the Events folder, and select
.
-
Enter the
event handler Name.
-
(Optional) Select
Disable Event to stop the event handler from executing when the scheduled time or triggering condition occurs.
A
trigger
statement does not execute a disabled handler.
-
Select the
Execution Location.
-
All – the default value. All databases execute the event.
-
Consolidated – restricts the databases at which an event is handled.
-
Remote – restricts to remote sites the databases at which an event is handled.
-
(Optional) Enter a description in the
Comments field.
-
Select a Trigger Type.
Trigger type |
Description |
Manual
|
If you create an event handler without a schedule or system event to trigger it, the handler is executed only when triggered manually.
|
Schedule
|
-
Click
Next.
-
Click
Add.
-
Enter the
schedule Name.
-
Under the
General tab, set the start time you want the event to trigger. Use the
At option to specify an exact time, or select the
Between option to enter a time range.
-
Select
Start Date, then click
Change Date to display an
Event Calendar dialog from which you can select a month and day, which must be greater than or equal to today's date. Click
OK to return to the
Schedule page.
-
Under the
Repeat tab, indicate how often the event should repeat. Select
Repeat Every to set the repeat frequency. Select
Execute Event On to choose the
Day(s) of the Week option or the
Days of the Month option. Select the days of the week or month you want the event to repeat.
-
Click
OK to complete the schedule. You can schedule more events by selecting
Add in the Provide the Schedule Information
page and repeating the above process.
|
Condition
|
-
Click
Next.
-
Select one of the predefined system events from the list above the table.
-
Specify the Conditions and their corresponding operators, values, and units.
|
- Click
Next and specify save and execution
properties.
Field |
Description |
Generate Script |
Generate a SQL file for the object. |
Enter or Select the Parent Folder |
Specify an existing project or create a new project in
which to save the SQL file. |
File Name |
Enter the file name in which to store the
SQL code. |
Execute Immediately |
Execute the SQL code immediately. If you do not select this
option, you must complete execution of the SQL file later to create the object. |
Open in Editor After Creation |
Create the object and open it in its associated editor. |
- Click
Finish to create the event handler.