cancel
Showing results for 
Search instead for 
Did you mean: 

Does SQLA 9 support DDL Triggers

Former Member
2,907

I would like to know if a trigger / event could be executed when a table is created/altered/dropped etc.

So is it possible or is there some other way of achieving this goal?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

No, SQL Anywhere does not support triggers on DDL operations, only DML.

I can't think of anyway to automatically execute a sequence of SQL statements when a DDL operation is performed, but you can always do it manually (i.e. execute the SQL after each create/alter/drop statement).

Former Member
0 Kudos

thanks, i didn't think i would be able to, this was going to be used on an application i don't have control over the source so i can't do it manually after each statement. i might just monitor the systable, syscolumn tables for changes.

Answers (1)

Answers (1)

Breck_Carter
Participant

The transaction log contains a record of all DDL, and dbtran.exe can be used to read it.

VolkerBarth
Contributor
0 Kudos

So you're thinking of a loop making DBTRAN run "continuously" against the active log (possibly starting with the last checkpoint), and looking for "CREATE ..." in the generated SQL script? And then use these statements as starting point or check the schema for changes?

Or auditing with only the audit type DDL?

Foxhound 4.0 with a "live schema-monitoring" facility?

Breck_Carter
Participant
0 Kudos

I'll let you know after Foxhound 3.0 ships 🙂