SQL Server 2012 latest multiple db restore script

  • Hi,

    I'm testing a SQL server 2012 instance and I'm bringing a lot of SQL server 2005 databases, using backup/restore method, I have tested a few and it works without major problems till now.

    However, I want to restore a lot of them, what script or similar would help me ? I want to leave a script for future reference.

    Thanks a lot for your ideas

  • --Using a shared drive in a server

    --Initial Instance

    BACKUP DATABASE [Database1] TO DISK = N'\\share\Backups\Database1_20140417-0100.bak'

    WITH NOFORMAT, NOINIT, NAME = N'Database1s-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10;

    --Destination Instance

    RESTORE DATABASE [Database1]

    FROM DISK = N'\\share\Backups\Database1_20140417-0100.bak' WITH FILE = 1,

    MOVE N'Database1_Data' TO N'D:\DataFiles\Database1_Data.mdf',

    MOVE N'Database1_Log' TO N'E:\LogFiles\Database1_Log.ldf', NOUNLOAD, STATS = 10

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

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