Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to restore about 1000 backups with the latest diff (for about 1000 databases). Some data was deleted last night in one column of a table. So I need to run a script on each restored vs current database to repair the data loss.

I know how to get a restore script via the Sql Server Mgmt Studio GUI, but how can I get a restore script for all the databases on the server?

Perhaps, there is a SELECT statement I could run to get full backup file path and latest diff file path for every database on the server. If you know how to do this, let me know.

(And yes I know to just do restore a database one at at time, and then delete to conserve space, but I still need to automate because there are about 1000 databases).

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I think this two articles might help you to build your own version

Auto generate SQL Server restore script from backup files in a directory

Auto generate SQL Server database restore scripts

Good Luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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