• For five databases, I think I'd just write out the RESTORE statement five times and run the whole lot. The database names aren't going to change each time you do this, are they? You could do it with a table of database names and a cursor, but it sounds like a lot of effort to me.

    Is there any reason why you're changing the logical names of the files? The physical file names have to be unique across the server, but the logical file names have to be unique only across the database. That means you can keep the logical names from the parent database and dispense with those ALTER DATABASE statements.

    John