DDL Triggers

  • Hi,

    I we all know we can create the DDL trigger on server also.

    Can we create the DLL trigger on server which will audit all the DDL statements on all databases within the server?

    Regards & Thanks in advance.

    Abhijit More,

    Database Developer,

    http://www.sqlity.blogspot.com

  • Not as such. Some DDL triggers have server-level scope, some have database-level scope. So you can't create a server-level trigger to capture all ALTER TABLE statements, for example.

    For more information on DDL trigger scope, check out BOL:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/a3d3c1a5-6ca0-465b-b1d4-f197dd2b682d.htm



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • With Event Notifications you could define all DDL events on the server scope.

    http://msdn.microsoft.com/en-us/library/ms180824.aspx

    Ola Hallengren

    http://ola.hallengren.com

Viewing 3 posts - 1 through 2 (of 2 total)

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