Astute SQL-ers may attempt to add a trigger to the
restorehistory
table over in msdb. It’s in thedbo
schema, which might make you hopeful. We all know triggers in that peskysys
schema don’t do a darn thing.You guessed it, restores get tracked there. So there’s, like, something inside SQL telling it when a restore happens.
Guess what, though? A trigger on that table won’t fire. Not
FOR INSERT
, notAFTER INSERT
, and not nothin’ in between.
Read on for more things that don’t work… Also check out the comments; I think Dave Mason has the best answer there.