locked
Trigger for Database_Restore Alert RRS feed

  • Question

  • We have created DDL server level trigger like, 

    for CREATE_DATABASE, ALTER_DATABASE, DROP_DATABASE,
    CREATE_ENDPOINT, ALTER_ENDPOINT, DROP_ENDPOINT,
    CREATE_LOGIN, ALTER_LOGIN, DROP_LOGIN,
    GRANT_SERVER, DENY_SERVER, REVOKE_SERVER,
    ALTER_AUTHORIZATION_SERVER

    Like this how to include something like RESTORE_DATABASE is it possible or how to write trigger for alert if any DATABASE RESTORE.


    Wednesday, September 28, 2016 7:59 PM

Answers

  • Tom's link show you how you can accomplish this. Just to spell it out clearly: you cannot capture some events using DDL triggers. RESTORE DATABASE is on that you cannot catch. So you have to use some other method.

    Tibor Karaszi, SQL Server MVP (Web Blog)

    • Marked as answer by VijayKSQL Friday, September 30, 2016 5:58 PM
    Thursday, September 29, 2016 7:02 AM

All replies