ASA SQL User's Guide
Using Procedures, Triggers, and Batches
Introduction to triggers
You can modify an existing trigger using either Sybase Central or Interactive SQL. You must be the owner of the table on which the trigger is defined, or be DBA, or have ALTER permissions on the table and have RESOURCE authority.
In Sybase Central, you cannot rename an existing trigger directly. Instead, you must create a new trigger with the new name, copy the previous code to it, and then delete the old trigger.
Alternatively, you can use an ALTER TRIGGER statement to modify an existing trigger. You must include the entire new trigger in this statement (in the same syntax as in the CREATE TRIGGER statement that created the trigger).
For more information on altering database object properties, see Setting properties for database objects.
To alter the code of a trigger (Sybase Central)
Open the Triggers folder.
Select the desired trigger. You can then do one of the following:
Edit the code directly on the SQL tab in the right pane.
Translate the code to Watcom-SQL or Transact-SQL prior to editing it:
Right-click the desired trigger and choose Open as Watcom-SQL or Open as Transact-SQL from the popup menu.
Edit the code on the SQL tab in the right pane.
Edit the code in a separate window by right-clicking the procedure in the right pane and choose Edit In New Window from the popup menu.
TipIf you wish to copy code between triggers, you can open a separate window for each trigger. |
To alter the code of a trigger (SQL)
Connect to the database.
Execute an ALTER TRIGGER statement. Include the entire new trigger in this statement.
For more information, see ALTER TRIGGER statement.