Email after DB restore completion

  • Hi,

    I have a DB that gets restored from from different server everyday. Once the database restore is completed, I would like to get a n email saying restore is complete. The restore will happen some time between 11:00 am and 5:00 PM. Not sure how to configure an email in this case

  • Is it a scheduled job? If so, just add an extra step to send an email.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi,

    Yes its a Store proc which gets called remotely and the restore happens through network. Now if I have to add a another step or another few lines in that Store proc. I need to go through SDLC(Dev & Engg) and which is going to take a lot of time.

    Instead I would like to design a job on the target server which checks the msdb..RestoreHistory . If I have the database with today's time stamp, then shoot and email saying Publish is complete. Out database publish happens only once a day.

    Not sure how to tweak the column "Restore_Date" according to my requirement which is today's Time stamp.

  • Mac1986 (10/22/2012)


    Hi,

    Yes its a Store proc which gets called remotely and the restore happens through network. Now if I have to add a another step or another few lines in that Store proc. I need to go through SDLC(Dev & Engg) and which is going to take a lot of time.

    Instead I would like to design a job on the target server which checks the msdb..RestoreHistory . If I have the database with today's time stamp, then shoot and email saying Publish is complete. Out database publish happens only once a day.

    Not sure how to tweak the column "Restore_Date" according to my requirement which is today's Time stamp.

    That's what I'm saying... just create an SQL Server Job (a "Maintenance Task" would do) to call the proc and send an email with whether or not the proc ran correctly or not.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply