Contents
What happens to a trigger if a table is dropped?
Dropping a table removes the table definition from the data dictionary. All rows of the table are no longer accessible. All indexes and triggers associated with a table are dropped.
When you drop a table all its trigger objects are deleted with it?
Dropping a table invalidates dependent objects and removes object privileges on the table. If you want to re-create the table, then you must regrant object privileges on the table, re-create the indexes, integrity constraints, and triggers for the table, and respecify its storage parameters.
What happens if a table is dropped and rename and?
The first constraint merely states that a trigger cannot exist if the schema it is in does not itself exist, The second one states that the EVENT_OBJECT_TABLE (the table from which the trigger is fired) must exist in the catalog and schema, or else if that other condition evaluates to true.
Can a table be renamed while leaving the existing triggers behind?
The perfect scenario in this case would probably be for the triggers to temporarily “detach” themselves from the table once it gets renamed (still point to the old table name which would not exist at that point), and then would be once again functional when the newly created clustered table appears. However I’m not sure if this is possible.
What happens when you rename a table in DDL?
The triggers do not reference the table by name, only the DDL that creates them does that. They reference the internal identifier of the table, so when you rename the table the trigger does not change at all. However, if you reverse-engineer the DDL for the trigger from the database the code will of course reference the new name of the table.
What happens if you change the name of a trigger?
However, if you reverse-engineer the DDL for the trigger from the database the code will of course reference the new name of the table. Code inside the trigger is not changed if it specifically references the table name, but that’s hopefully not the case.