Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Albert Rognan: "Thank you for this quick reply. I must say I am impressed of the number of functions that is available within this tool".
Jim Salmons: "That is excellent news! I will look forward to a future update with these features. It will be attention to such details that further distinguishes your excellent products from the competition.

As always, I appreciate your great products and your demonstrated customer service is equal to the high quality of your products".

More

Add your opinion

MS SQL Maestro online Help

Prev Return to chapter overview Next

DDL Triggers

DDL triggers, like standard triggers, execute stored procedures in response to an event. But unlike standard triggers, they do not execute procedures in response to UPDATE, INSERT, or DELETE statements on a table or view. Instead, they primarily execute in response to data definition language (DDL) statements. These include CREATE, ALTER, DROP, GRANT, DENY, REVOKE, and UPDATE STATISTICS statements. DDL triggers are available in Microsoft SQL 2005 and higher.

 

 

New DDL Triggers are created within Create DDL Trigger Wizard. In order to run the wizard you should either

 

select the Object | Create Database Object... main menu item;
select the DDL Trigger icon in the Create Database Object dialog

or

select the DDL Triggers list or any object from that list in the explorer tree;
select the Create New DDL Trigger... item from the popup menu

or

open the database in Database Editor and the DDL Triggers tab there;
press the Insert key or select the Create New DDL Trigger... item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

       

To create a new DDL Trigger with the same properties as one of the existing DDL Triggers has:

 

select the Object | Duplicate Database Object... main menu item;
follow the instructions of Duplicate Object Wizard.

 

 

 

DDL Triggers can be edited within DDL Trigger Editor. In order to run the editor you should either

 

select the DDL Trigger for editing in the explorer tree (type the first letters of the DDL Trigger name for quick search);
select the Edit DDL Trigger ... item from the popup menu

or

open the database in Database Editor and the DDL Triggers tab there;
select the DDL Trigger to edit;
press the Enter key or select the Edit DDL Trigger item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

       

You can change the name of the DDL Trigger using the Rename DDL Trigger dialog. To open the dialog you should either

 

select the DDL Trigger to rename in the explorer tree;
select the Rename DDL Trigger item from the popup menu

or

open the database in Database Editor and the DDL Triggers tab there;
select the DDL Trigger to rename;
select the Rename DDL Trigger item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

 

 

 

To drop a DDL Trigger:

 

select the DDL Trigger to drop in the explorer tree;
select the Drop DDL Trigger item from the popup menu

or

open the database in Database Editor and the DDL Triggers tab there;
select the DDL Trigger to drop;
press the Delete key or select the Drop DDL Trigger item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

 

and confirm dropping in the dialog window.

 



Prev Return to chapter overview Next