I have an insurance claims table (TableX for this example) as well as an Audit table (TableXAudit). The trigger associated with TableX inserts records on Insert, Update and Delete (as you would expect an audit trigger to do). However, TableX is still being modified (adding/removing columns) as the project is being fleshed out. I discovered, the hard way, that using the Drop/Create Table script, to make table changes, results in the Trigger being dropped but not recreated.
My question; Is there a way to preserve the trigger on table Drop/Create?
Thanks.
I know this is old, but this seems to work for the common case. It creates a script to drop and recreate the triggers. You can then place your drop table code in the midst of it.