Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011

    Unanswered: Restoring multiple databases from a single .bak

    I have a single .bak file containing full backups of 20+ databases.
    Whats the best way of creating and restoring these database onto an instance on a separate server. A script or procedure will be greatly appreciated.
    Please note that this is to migrate the whole instance of sql server onto a newly build server. Any guidance re steps will be appreciated.


  2. #2
    Join Date
    Jan 2003
    Provided Answers: 11
    not knowing the order in which the databases were backed up will be a bit of a pain, but it can be done. use RESTORE HEADERONLY and redirect the output to a table to get the list of database names, and file ids that correspond to their backups. Then loop through that table, and execute the restore database command with the appropriate database name and file id parameters.

    I doubt anyone has a script for this, because it is a bit of a rare need. Will you be doing this often?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts