finding which file to restore from?

  • i know that a backup device can have multible backups within it, and you can restore to a specific one using the below script:

     
    RESTORE DATABASE MyAdvWorks   FROM MyAdvWorks_1   WITH NORECOVERYRESTORE DATABASE MyAdvWorks   FROM MyAdvWorks_1   WITH FILE = 2
     
    What i want to know is , besides using the SMSS interface, is there a script 
    that can be used to tell you how many files in a particular backup device, and the
    date those backups were created at?
  • Winston,

    Have a look at RESTORE HEADERONLY and RESTORE FILELISTONLY,

    - James

    --
    James Moore
    Red Gate Software Ltd

  • Apart from that have a look at the backup tables to know which file to restore from.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

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

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