Is it possible to trigger a database trigger during recovery in SQL 2005 or 2008

I have some book storage tasks (reset high water marks, clear some phased data) that need to be performed after each restore of the QA database. I know that I can create triggers for databases in SQL, but it seems I cannot find a way to do this when restoring the database.

Since I’m working on a team of people sharing a database, I don’t always know when recovery occurs. Is there a way to automate this either with a trigger or with some other database magic so that the cleanup routine is always called?

+3
source share
2 answers

There is no DDL trigger for RESTORE, however an Event Notification for an eventAUDIT_BACKUP_RESTORE_EVENT that takes you to where you want.

+6
source

Source: https://habr.com/ru/post/1709805/


All Articles