简体   繁体   中英

Is it possible to have a database trigger on restore in SQL 2005 or 2008

I have some book keeping tasks (reset high water marks, clear some staged data) that need to be done after each restore of a QA database. I know that I can create triggers on databases in SQL but I do not seem to be able to find a way to do it on a database restore.

Since I work on a team of people with shared ownership of the database, I cannot always know when a restore occurs. Is there a way to automate this either with a trigger or some other database magic so that the cleanup procedure will always be called?

RESTORE没有DDL触发器,但是AUDIT_BACKUP_RESTORE_EVENT事件的事件通知 ,它将为您提供所需的位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM