简体   繁体   中英

SQL Server Management Studio Restore Database only restores databases one at a time

I am using SQL Server Management Studio 2014; I am trying to restore a number of databases and encountered some strange behavior.

在此处输入图片说明

As expected, the "Add" button allows me to add several .bak files.

Everything proceeds normally. However, when it finishes importing, it shows me a dialog saying "Database '[name]' imported successfully", where [name] is the name of the first .bak file I added.

在此处输入图片说明

Indeed, I can confirm looking at the Databases in Object Explorer that it added only the first .bak file on the list; none of the other items were restored.

I've seen posts that suggest how to write scripts to do this kind of an import, but I'd prefer to do it from the UI.

Does anyone know what could be causing this behavior and how to fix it?

Yeah, suppose I could just do them one at a time as a workaround, but that's really time-consuming and error-prone - I'd rather just be able to restore all of them at once.

That is the defined behaviour. The Add button allows you select a backup that uses more than one file. The full process involves selecting a database first and then restoring that. As you mention in your question there is the option of using scripts and you can use the interface to give you the script. All you need to do then is to run the scripts as a batch.

If you open a New Instance of SQL Management studio you could do more than one at once. This would be the way to work around the built in GUI limitation if you are doing the restore/backup manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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