• Last commnent: If all study works has finished, you can easily drop all the triggers at onnce,.

    Here the example for the DEL Trigger

    use AnyDatabase

    /***************************************************************/

    /* */

    /* Codigo para borrar un trigger en cada tabla de una */

    /* base de datos. */

    /* */

    /* 08/07/2012 Patrick Zumstein */

    /***************************************************************/

    /* Crear tabla que contiene los nombres de todas las tablas */

    create table #allTables

    (

    tablavarchar(255)

    )

    /* Llenar la tabla temporal con los nombre de todas las tablas */

    insert into #allTables (tabla)

    (

    SELECT INFOS.[TABLE_NAME]

    FROM INFORMATION_SCHEMA.Tables AS INFOS

    WHERE TABLE_TYPE = 'BASE TABLE'

    )

    declare @miTabla varchar(255)

    DECLARE @supercmd NVARCHAR(2500)

    DECLARE curSUPER CURSOR FOR

    select tabla from #allTables

    open curSUPER

    /* Iterar por todas las tablas */

    FETCH NEXT FROM curSUPER INTO @miTabla

    WHILE @@FETCH_STATUS = 0

    BEGIN

    /* Crear el comando que se debe ejecutar en cada tabla */

    /* NOTA: Este comando contiene otro comando para ejecutarse posteriormente (Autodesactivación) */

    SET @supercmd ='

    DECLARE @C AS varchar(500)

    SET @C = ''' + 'DROP TRIGGER ' + @miTabla + '_T_D;''

    EXEC (@c)'

    /* Ejecutar el comando */

    EXEC (@supercmd)

    SET @supercmd = ''

    FETCH NEXT FROM curSUPER INTO @miTabla

    END

    CLOSE curSUPER

    DEALLOCATE curSUPER

    /* Borrar tabla temporal */

    drop table #allTables

    Ok, hope it helps, and happy SQL .....