Link to home
Start Free TrialLog in
Avatar of dedri
dedriFlag for United States of America

asked on

restore sql database-generate restore script from files in folder

Very often I have a request to restore sql server databases from production to out test environment for a couple of out DB servers.  Every DB servers are having around 10-15 databases on it.
Format of the backups are : DB1_backup_201305151900.bak.
When I have a request  I restore this dbs from tape to one folder on the disk, and after that I have to manually restore them. It's really a hard work and I need to automate this somehow.
If it is possible to generate a restore script from the files in directory?
The problem that need to be solved also is that db file location in production are located in drive D: and E: and on test environment only on disk E:
Avatar of jogos
jogos
Flag of Belgium image

Avatar of dedri

ASKER

hi, anything that does not involve powershell. My SQL servers are sql server 2005 and windows 2003
Avatar of Qlemo
Avatar of dedri

ASKER

Hi Qlemo, 10x for your reply.
I've already checked this article. The problem with this script is  that it is only for one database, and I am having 10-15 databases in the folder. Also it does not provide the option to move database( on my production server databases are located on the D:\- data files  and E:\ - log files), and on test servers they are all on one drive D:\
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dedri

ASKER

10x