This script creates the script to restore your database with the information existing in [msdb] database.
It helps you by finding the last FULL backup, the last DIFFERENTIAL backup and all the TRANSACTION LOG backups needed.
It's quite comfortable when you are doing so many differential or log backups.
I hope you enjoy it!!!
This script is based on the script done by [jtshyman] named "List SQL backups"
The variable @DBName should be set to the name of the database you want to query on.
It is not case sensitive unless your collation is.
The variable @Days should be set to how many days back in the records you want to list backups for. By default set to 14 (old enought I think).