I searched in the internet but cannot find clear and direct way. I have a folder which include 100 databases as full backup, another folder contains all logs for these 100 DBs.

I need a script to do the automate restore for these DBs?

The names for backup files are different, for example

Adventure_Work_06162015_220000.bak Adventure_Work_06012015_150000.bak

and so on, appreciate your help and cooperation.

up vote 2 down vote accepted

I would suggest to use Restore Gene written by Paul Brewer.

There is a T-SQL [sp_RestoreGene] and PowerShell version [ps_RestoreGene] of it and you can use it / customize it as per your needs.

SQLServerCentral.com has an excellent article by the author on how to configure and describes the working of it as well - Restore Gene : Automating SQL Server Database Restores.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.