• Nice article. I would like to point out however, that in your article, your suggestion to prevent Bob from disabling the trigger is invalid. First, you provide a way to detect if Bob DROPs the trigger, not DISABLEs it.

    Therefore, solution #2 would not work if Bob simply disables the trigger either from code or from SSMS. Additionally, there is a known problem on SQL Server where the DISABLE TRIGGER command is not caught by DDL triggers. See here: http://connect.microsoft.com/SQLServer/feedback/details/509242/fire-a-ddl-trigger-when-the-new-syntax-disable-trigger-is-executed

    So the correct trigger would be:

    USE HR

    GO

    CREATE TRIGGER dbo.stopDroppingTriggers

    ON DATABASE

    FOR ALTER_TABLE

    BEGIN

    DECLARE @xmlEventData XML;

    DECLARE @DDLStatement nvarchar(max);

    SELECT @xmlEventData = EVENTDATA();

    SET @DDLStatement = @xmlEventData.value( '(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]', 'nvarchar(max)' );

    IF @DDLStatement like '%disable%trigger%'

    BEGIN

    ROLLBACK;

    PRINT 'Dropping triggers is not allowed.'

    END

    END

    But even with this DDL trigger, it would only cover the use case when a user disables the trigger by using the ALTER TABLE syntax, it would not cover the DISABLE TRIGGER syntax and if the user uses SSMS's right-click disable trigger feature because of the defect in SQL Server.