Script out multiple differential restore backups

  • I am working on a migration of SQL 2012 to 2014 and I am trying to eliminate down time as much as possible. I have worked with other on this forum on getting a script to restore all my system database 500+ and I decided I want to put them all in to NORECOVERY so then I can then reduce the down time to the time it takes to make a differential backup and restore it on the new server versus taking a full backup during the downtime which will take a while.

    So my question is, there any way have a script run though my Differenttial folder and produce multiple restore lines like this one.

    I got this from scripting out a differential restore from a NORECOVERY full backup

    RESTORE DATABASE [db] FROM DISK = N'F:\path\to\full\backup.bak' WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 5

    RESTORE DATABASE [db] FROM DISK = N'F:\path\to\diff\backup.bak' WITH FILE = 1, NOUNLOAD, STATS = 5

    GO

Viewing 0 posts

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