AFTER DDL ON DATABASE Trigger

  • In Oracle its possible to place a trigger at a database level. What we do is track DDL changes and add to an audit table. Is there an equivalent process I can use for SQL Server?

  • There's built-in C2 Auditing, which I suppose is a bit over the top for your purposes, or the alternative is writing and scheduling a continuous server-side Profiler trace with customer events selected. Various events availavble to Profiler cover DDL stuff.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • thanks Mark. As you mentionned is a little bit of over kill but it could work. Is there anything I can do on the sysobjects table?

  • 'fraid not Steve. Trigger on system tables aren't supported.

    However, I do have plans to write a (customisable) auditing procedure. If I pull my finger out I might get it done this weekend.... um, er, better make that this month.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • cheers mark -> thought that was the case on the sysobjects but never did confirm. would be a cool feature mr. gates (!?)

  • Hi Mark,

    quote:


    There's built-in C2 Auditing, which I suppose is a bit over the top for your purposes, or the alternative is writing and scheduling a continuous server-side Profiler trace with customer events selected. Various events availavble to Profiler cover DDL stuff.


    the main problem with C2 auditing is, that you are not able to select what you want to be audited and what not. To me it seems like an all or nothing approach, and as such certainly an overkill.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • G'day Frank.

    Absolutely. I turned it on once, for 5 minutes, just to see what we got. Yuk!

    BTW: I'm no longer getting email notifications "whenever anyone replies to a topic". Are you?

    Cheers,

    - Mark


    Cheers,
    - Mark

  • quote:


    BTW: I'm no longer getting email notifications "whenever anyone replies to a topic". Are you?


    no!

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

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

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