SQL Script to Enable/Disable all triggers in a Database

One thing I find myself doing frequently is enabling/disabling triggers in an InforCRM database, especially with users who are not utilizing any of the newer ERP integration features found in current versions of InforCRM.

This script can be used to mass enable or disable all triggers in a database. Change which Declaration of the @action variable to switch between Enabling and Disabling triggers. Running this script will generate the statements to change the state of the triggers, while also running them. You can disable the Exec line to just get a list of Enable/Disable statements that you can run yourself.