First you must configure the mail of the database. Then you must create the Sql server agent job with the request, which you can get from the recovery page using the script as a new request window. then you must create an agent in the Sql Server Agent to send email to the desired mail database. in your task, you can indicate that if the task fails or the work is successful, or in both cases, the operator sends you an email. If you want to delete the restored table, you can create a table for the recovery result, and in your recovery code you can change the try / catch in the transaction state if the restore was successfully inserted into the table and complete the transaction, otherwise it will delete the table. You must create another task in the Agent and execute a query to search for a commit in this table, if true, and then delete the restored database, otherwise you can write a query for execution that will send you an email. You can read about this request here: http://technet.microsoft.com/enus/library/ms189505(v=sql.105).aspx
Hope that would be helpful
chakere hame iroonia;)
source share