I have an interesting question:
I have a table with trigger names, called Foo and the Foo.TriggerName field stores trigger names. If I delete a row from Foo, I would like a trigger which would drop the trigger with the name Foo.TriggerName.
Example:
Foo
ID, TriggerName
1, 'Lorem'
2, 'Ipsum'
3, 'Bar'
When I am deleting the row with ID = 3, I would like to automatically delete the trigger with the name 'Bar'. How can I achieve this?
You can try to use dynamic sql
You can define a trigger for delete on Foo
and in trigger you can do dynamic sql call