Nothing to audit a DISABLE TRIGGER statement

  • I found an interesting post on Microsoft Connect on the subject: http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=509242 .

    Apparently there's no way to know (even with the Profiler) when/how/who... disable a trigger with the new statement DISABLE TRIGGER [...]. That's really annoying when you need to audit for security purpose your production databases on which a trigger is set to limit or trace user's action for example.

    Can some DBA masters post their opinion on the subject? If you have a workaround, it is welcome!

    --
    Philippe RUELLO
    Database Project Manager

  • You can see the DISABLE TRIGGER command using SQL Trace (Profiler). It comes through as TextData in the SQL:Batch* and SQL:Stmt* events, it does not have a specific event.

    Now as far as this event not being available for auditing/blocking in DDL triggers, well, that is another issue.

  • And since this is a SQL 2008 thread if you are running a SQL Audit on the audit group "SERVER_OBJECT_CHANGE_GROUP".

    SQL 2008 BOL Oct 2009: http://msdn.microsoft.com/en-us/library/cc280663.aspx

    BTW SQL Audit is cool..

    CEWII

  • Hello Jack and Helliott,

    Thanks for the feedback.

    Jack I see the trace in the profiler (with no event) with object name as "ENABLE DISABLE TRIGGER". Thanks for the info. But it's really a big overhead to let a profiler on a production server to simply audit this kind of statements.

    Helliott, I saw the SQL Audit functionality but it's only available in the enterprise edition. As we only have the standard edition here, it's not helpful for us by now.

    Kind regards,

    --
    Philippe RUELLO
    Database Project Manager

  • Actually if you use a server-side trace with only the sql:stmtcompleted event filtering on TextData you probably wouldn't even realize the trace is running. Are you aware that with 2005/2008 there is a trace running by default, called the Default Trace, that collects data for 34 (2005) or 35 (2008) events?

  • pruello-1014825 (11/10/2009)


    Elliott, I saw the SQL Audit functionality but it's only available in the enterprise edition. As we only have the standard edition here, it's not helpful for us by now.

    Alas I forgot about that part..

    CEWII

  • Jack Corbett (11/10/2009)


    Actually if you use a server-side trace with only the sql:stmtcompleted event filtering on TextData you probably wouldn't even realize the trace is running. Are you aware that with 2005/2008 there is a trace running by default, called the Default Trace, that collects data for 34 (2005) or 35 (2008) events?

    Thanks Jack for suggesting that solution. I'll have a look on Friday on the way I can implement that.

    --
    Philippe RUELLO
    Database Project Manager

  • Jack Corbett (11/10/2009)


    Actually if you use a server-side trace with only the sql:stmtcompleted event filtering on TextData you probably wouldn't even realize the trace is running. Are you aware that with 2005/2008 there is a trace running by default, called the Default Trace, that collects data for 34 (2005) or 35 (2008) events?

    Thanks ahead for the info Jack. Default trace cannot be modified but I created mine with TextData filtered on '%DISABLE%TRIGGER%' having a transactionID as there's no peculiar event for this kind of statement.

    Works fine. Best regards,

    --
    Philippe RUELLO
    Database Project Manager

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply