简体   繁体   English

SQL Server 2005-如何还原多个备份(.bak)

[英]SQL Server 2005 - How to restore multiple backups (.bak)

I need to restore near 40 databases (.bak files) to a new SQL Server 2005 instance. 我需要将40个数据库(.bak文件)还原到新的SQL Server 2005实例。
Manually, from SQL Server Management Studio, takes a long time. 从SQL Server Management Studio手动进行需要花费很长时间。
¿How can I restore automaticaly all the .bak files to the new Server? ¿如何将所有.bak文件自动恢复到新服务器?
The new SQL Server instance is empty. 新的SQL Server实例为空。
Thanks for the help! 谢谢您的帮助!

SQL Server backups can be scripted like, literally, everything else. 从字面上看,SQL Server备份可以像其他所有脚本一样编写。 You can find out about it on Google. 您可以在Google上找到相关信息。 Search for "SQL Server restore statement". 搜索“ SQL Server恢复语句”。

Let me quote commenter Murph who had a very nice idea: 让我引用评论者默弗(Murph)的想法:

Its easier than that to get the script - when you do a restore with SQL Server Manager you get the option to create a script instead of run the restore, that will give you the basis from which you can build all the scripts you need. 它比获取脚本更容易-使用SQL Server Manager进行还原时,您可以选择创建脚本而不是运行还原,这将为您提供构建所有所需脚本的基础。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM