I have about 6 triggers that are disabled. I need to enable whenever I do some sort of security changes to the application. Instead of enabling/disabling the trigger one by one, I need help with one script to check the status of these 6 triggers.
I want to disabled the 6 triggers if it's in enabled state, and enabled all 6 if it's on disabled state.
I did a query to see which triggers is disabled and which one enabled, but not sure how I can incorporate this into my sql script.
SELECT NAME, IS_DISABLED FROM SYS.TRIGGERS
So I want to create a stored procedure that when execute, will check status. If it's disabled (Is_Disabled = 1), then enable it. If it's enable (Is_Disabled = 0) then disabled it. Also return the current status of the 6 triggers after running the stored procedure. Any thoughts?