steps to generate the automated process:
- manually go througt the RESTORE GUI and generate a script for the complete restore command
- change the name of the backupfile in the generated RESTORE script to a variable
- wrap the code in a stored procedure with a required variable for the backupfile
- query the MSDB backup tables (backupset, backupmediaset, etc.) to get the name of the most recent backup
- call the stored procedure using the value for the backupfile from the MSDB tables
- put code from the above step into a nightly job
It's probably a bit more compex then Andrew mentioned, but it's not that hard either 😉