Home Forums SQL Server 2005 Backups Script to restore red gate backups automatically from a folder. RE: Script to restore red gate backups automatically from a folder.

  • Maybe a script like this would help you find the most recent backup and it's path:

    select top 1 bset.database_name, bset.Type, media.physical_device_name, backup_start_date

    from msdb.dbo.backupset bset

    join msdb.dbo.backupmediafamily as media on bset.media_set_id = media.media_set_id

    where database_name = 'Database_Name'

    and type = 'D' -- Full

    order by backup_start_date desc