***Restore multiple sql databases***

  • I have about 100 db's with mdf, ldf, and ndf files that I need to restore to the SQL 2008R2 on different instance. I have all the backups in their respective folders. Is there a script out there that will restore all of them in one swoop??

    Thank you in advance, as always! God Bless

  • hydbadrose (6/14/2013)


    I have about 100 db's with mdf, ldf, and ndf files that I need to restore to the SQL 2008R2 on different instance. I have all the backups in their respective folders. Is there a script out there that will restore all of them in one swoop??

    Thank you in advance, as always! God Bless

    nope, no built in functionality;

    you'll want to write a script that creates the commands from the metadata; peek at the scripts section hear on SSC for something that might be 90% of what you are after:

    http://www.sqlservercentral.com/search/?q=restore+all+databases&t=s

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • If you have the system tables on the original server and kept the same filenames and directory structure on the new server, you might be able to use a SELECT statement on the original server to generate the SQL RESTORE command on the new server if you're using backup files to do the transfer.

    If you're not using backup/restore but want to use the MDF/LDF files, you might be able to query the attach commands, but I'm not as familiar with this. I prefer to use BACKUP and then RESTORE on the new server.

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

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